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

From
David Laight <hidden>
Date
2018-03-22 15:13:10
Also in
lkml, netdev
Reply to
Kees Cook, 2018-03-22
From: Kees Cook
Sent: 22 March 2018 15:01
...
quoted
  /* Glory to Martin Uecker [off-list ref] */
  #define __is_constant(a) \
        (sizeof(int) == sizeof(*(1 ? ((void*)((a) * 0l)) : (int*)1)))
...
So, this time it's not a catastrophic failure with gcc 4.4. Instead it
fails in 11 distinct places:
...
Seems like it doesn't like void * arguments:

mm/percpu.c:
                void *ptr;
...
                base = min(ptr, base);
Try adding (unsigned long) before the (a).

	David
Thread (37 messages) 37 messages, 10 authors, last reply 2018-03-22
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