This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH]: Add a new option -Wvariable-length-array
On Tue, 6 Feb 2007, Seongbae Park wrote:
> Ok. Does the following behavior look reasonable ?
>
> # cat vla.c
> int test(int i, char a[i]);
> # sh -v x
> ...
> $gcc vla.c -c
> $gcc vla.c -c -pedantic
> vla.c:1: warning: ISO C90 forbids variable length array 'a'
> $gcc vla.c -c -pedantic-errors
> vla.c:1: error: ISO C90 forbids variable length array 'a'
> $gcc vla.c -c -Wvariable-length-array
> vla.c:1: warning: variable length array 'a' is used
> $gcc vla.c -c -Wvariable-length-array -pedantic
> vla.c:1: warning: ISO C90 forbids variable length array 'a'
> $gcc vla.c -c -Wvariable-length-array -pedantic-errors
> vla.c:1: error: ISO C90 forbids variable length array 'a'
> $gcc vla.c -c -Wno-variable-length-array
> $gcc vla.c -c -Wno-variable-length-array -pedantic
> $gcc vla.c -c -Wno-variable-length-array -pedantic-errors
Yes.
--
Joseph S. Myers
joseph@codesourcery.com