This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]