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

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
2018-03-16 17:29:16
Also in
linux-input, lkml
Reply to
Florian Weimer, 2018-03-16
On Fri, Mar 16, 2018 at 4:47 AM, Florian Weimer [off-list ref] wrote:
If you want to catch stack frames which have unbounded size,
-Werror=stack-usage=1000 or -Werror=vla-larger-than=1000 (with the constant
adjusted as needed) might be the better approach.
No, we want to catch *variable* stack sizes.

Does "-Werror=vla-larger-than=0" perhaps work for that? No, because
the stupid compiler says that is "meaningless".

And no, using "-Werror=vla-larger-than=1" doesn't work either, because
the moronic compiler continues to think that "vla" is about the
_type_, not the code:

   t.c: In function ‘test’:
   t.c:6:6: error: argument to variable-length array is too large
[-Werror=vla-larger-than=]
     int array[(1,100)];

Gcc people are crazy.

Is there really no way to just say "shut up about the stupid _syntax_
issue that is entirely irrelevant, and give us the _code_ issue".

                 Linus
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