Thread (37 messages) 37 messages, 10 authors, 2018-03-22

Re: [PATCH v5 0/2] Remove false-positive VLAs when using max()

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2018-03-22 17:04:14
Also in: lkml, netdev

On Thu, Mar 22, 2018 at 8:01 AM, Kees Cook [off-list ref] wrote:
Seems like it doesn't like void * arguments:
Yeah, that was discussed separately, I just didn't realize we had any
such users.

As David said, just adding a (long) cast to it should be fine, ie

  #define __is_constant(a) \
         (sizeof(int) == sizeof(*(1 ? ((void*)((long)(a) * 0l)) : (int*)1)))

and is probably a good idea even outside of pointers (because "long
long" constants could cause warnings too due to the cast to (void *)).

                Linus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help