Re: [PATCH v3 5/5] minmax: Relax check to allow comparison between int and small unsigned constants.
From: Linus Torvalds
Date: Fri Aug 04 2023 - 14:14:32 EST
On Fri, 4 Aug 2023 at 03:56, David Laight <David.Laight@xxxxxxxxxx> wrote:
>
> Convert constants between 0 and INT_MAX to 'int' prior to comparisons
> so that min(signed_var, 20u) and, more commonly, min(signed_var, sizeof())
> are both valid.
I really think this whole series is broken.
What does the "are both valid" even *MEAN*?
It's simply not valid to do a "min(int, 20u)". What is the meaning of
it? You seem to think that the meaning is to do the operation in
"int". Why?
You made up a definition of "valid" that I think is completely invalid.
Linus