This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: egcs / g++ conflicts c++ draft standard (i think)
- To: jbuck at synopsys dot com, fneves at excon dot com dot br
- Subject: Re: egcs / g++ conflicts c++ draft standard (i think)
- From: Carlo Wood <carlo at runaway dot xs4all dot nl>
- Date: Sat, 25 Jul 1998 14:47:45 +0200 (CEST)
- Cc: egcs at cygnus dot com (egcs at cygnus dot com)
| Note that the standard allows
|
| class foo
| {
| static const int qtd = 100;
| };
|
| (as does g++) although many compilers don't yet implement it.
|
| (Perhaps it is time for g++ to allow only 'static', or to at least
| warn about other uses like this).
It already does:
~>g++ tst.cc
tst.cc:6: warning: ANSI C++ forbids initialization of const member `qtd'
tst.cc:6: warning: making `qtd' static
| > -- Dynamic allocation of array bounds (no const bounds)
Nevertheless, you need -pedantic before you get a warning:
~>g++ -pedantic tst.cc
tst.cc: In function `int main(int, char **)':
tst.cc:13: warning: ANSI C++ forbids variable-size array `dynarray'
I think that this warning should also be given, or probably even
be turned into an error, when compiling with -ansi :
~>g++ -ansi -Wall tst.cc
~>
(No warning or error)
--
Carlo Wood <carlo@runaway.xs4all.nl>