Quantcast
Viewing all articles
Browse latest Browse all 1267

Re: [PATCH v4 1/2] kernel.h: Introduce const_max() for VLA removal

Linus Torvalds writes: (Summary) I think all the existing users are of type "max_t()" anyway due to the very same issue, no?
very same issue, no?
At least if there's an explicit type like 'size_t', then passing in "-1" becoming a large unsigned integer is understandable and clear, not just some odd silent behavior.
not just some odd silent behavior.
Put another way: I think it's unacceptable that
Put another way: I think it's unacceptable that
const_max(-1,6)
const_max(-1,6)
magically becomes a huge positive number like in that patch of yours, but magically becomes a huge positive number like in that patch of yours, but const_max_t(size_t, -1, 6)
const_max_t(size_t, -1, 6)
*obviously* is a huge positive number.
*obviously* is a huge positive number.
The two things would *do* the same thing, but in the second case the type is explicit and visible.
type is explicit and visible.

[...]

this is rejected:
That sounds acceptable too, although the

Viewing all articles
Browse latest Browse all 1267

Trending Articles