This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Constant expression for array subscript operator
- To: rodrigc at mediaone dot net, tjw at omnigroup dot com
- Subject: Re: Constant expression for array subscript operator
- From: mike stump <mrs at windriver dot com>
- Date: Mon, 23 Jul 2001 09:09:31 -0700 (PDT)
- Cc: gcc at gcc dot gnu dot org
> Date: Fri, 20 Jul 2001 21:36:42 -0700
> From: "Timothy J. Wood" <tjw@omnigroup.com>
> Cc: gcc@gcc.gnu.org
> To: Craig Rodrigues <rodrigc@mediaone.net>
> > Should gcc emit an error message on the following piece of
> > code? gcc 3.0.1 seems to compile it without complaining,
> > and only issues a warning if I add the -pedantic flag.
> >
> > #include <cstdio>
> > void foo(int a)
> > {
> > char b[a];
> > std::printf("Hello %c\n", b[9]);
> > }
> This is a non-standard GNU extension (which is useful, of course).
I'd of course would say, this will be standard C++ and is already
standard C.