This is the mail archive of the gcc@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]

Re: Constant expression for array subscript operator


> 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.


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