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

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
2018-03-15 21:42:13
Also in
lkml, netdev
Reply to
Kees Cook, 2018-03-15
On Thu, Mar 15, 2018 at 12:47 PM, Kees Cook [off-list ref] wrote:
To gain the ability to compare differing types, the arguments are
explicitly cast to size_t.
Ugh, I really hate this.

It silently does insane things if you do

   const_max(-1,6)

and there is nothing in the name that implies that you can't use
negative constants.

                   Linus
Thread (19 messages) 19 messages, 5 authors, last reply 2018-03-16
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help