This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
RE: Questionable C/C++ statement
- From: Dave Gotwisner <Dave dot Gotwisner at harmonicinc dot com>
- To: 'Eljay Love-Jensen' <eljay at adobe dot com>, "'gcc-help at gcc dot gnu dot org'" <gcc-help at gcc dot gnu dot org>
- Date: Thu, 24 Jun 2004 11:36:24 -0700
- Subject: RE: Questionable C/C++ statement
Interesting. Using -pedantic with 3.2 gives a warning t.cc:7: warning: ISO
C++ forbids variable-size array 'buf`, but none of the others you mention.
I don't have g++ 3.3 available. Saurabh's response indicates it's legal
according to ISO C99.
Thanks, everyone.
Dave
-----Original Message-----
From: Eljay Love-Jensen [mailto:eljay@adobe.com]
Sent: Thursday, June 24, 2004 4:43 AM
To: Dave Gotwisner; 'gcc-help@gcc.gnu.org'
Subject: Re: Questionable C/C++ statement
Hi Dave,
GCC's g++ found some errors in the code, for me.
--Eljay
$ g++ -pedantic -W -Wall questionable.cpp
question.cpp: In function `void foo()':
question.cpp:7: error: ISO C++ forbids variable-size array `buf'
question.cpp: In function `int main(int, char**)':
question.cpp:22: warning: unused parameter `int ac'
question.cpp:22: warning: unused parameter `char**av'
$ g++ --version
g++ (GCC) 3.3.1 (cygming special)
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.