RE: [PATCH next v4 0/5] minmax: Relax type checks in min() and max().

David Laight posted 5 patches 1 year, 11 months ago
Only 0 patches received!
There is a newer version of this series
RE: [PATCH next v4 0/5] minmax: Relax type checks in min() and max().
Posted by David Laight 1 year, 11 months ago
From: Linus Torvalds
> Sent: 08 January 2024 18:19
...
> That said, I'm sure this thing exists to a smaller degree elsewhere. I
> wonder if we could simplify our min/max type tests..

Could the type-check be moved into one of the debug builds?
That would give the coverage without slowing down all builds?

Adding -Wsign-compare is a PITA until gcc adds value tracking
to it, not just a type check.
Otherwise it bleats about:
	int rval = fn();
	if (rval < 0)
		return rval;
	if (rval > unsigned_value)

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)