This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: c/6559: "-std=c99 -pedantic" displays c89 warning (fwd)
- From: "M. P. Halpin" <mphalpin at cc dot gatech dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 17 May 2002 01:21:31 -0400 (EDT)
- Subject: Re: c/6559: "-std=c99 -pedantic" displays c89 warning (fwd)
I just downloaded and installed the gcc3.1 release on my local
workstation (FreeBSD 4.5), however "-std=c99 -pedantic" is still giving
warnings when I compile code with VLAs (which it shouldn't, VLAs are legal
in c99).
So I grepped the source for the warning and found it in c-decl.c,
starting on line 4620:
if (pedantic)
{
if (TREE_CONSTANT (size))
pedwarn ("ISO C89 forbids array `%s' whose size can't be evaluated",
name);
else
pedwarn ("ISO C89 forbids variable-size array `%s'",
name);
}
Changing "if (pedantic)" to "if (pedantic && !flag_isoc99)" seemed to
fix the problem.