[cfe-commits] [PATCH] Make -Wvla warn in C99 mode (impact on -Wgnu?)

Douglas Gregor dgregor at apple.com
Mon Apr 11 19:25:08 PDT 2011


On Apr 11, 2011, at 5:14 PM, Eli Friedman wrote:

> Patch attached; I would just commit, but it changes the behavior of
> -Wgnu in a way I'm not sure is correct.  Can someone explain the
> intent for -Wgnu and why it includes -Wvla?  (The svn history only
> says it's supposed to "Control warnings about GNU extensions".)

-Wgnu is meant to warn about GNU extensions, and variable-length arrays in C89 are a GNU extension.

It looks like your patch will end up warning about VLAs under -std=gnu99 -Wgnu, which would be unfortunate.

	- Doug



More information about the cfe-commits mailing list