This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [C++0x PATCH] Remove auto as a storage class specifier
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Lawrence Crowl <crowl at google dot com>
- Cc: Andrew Pinski <pinskia at gmail dot com>, Doug Gregor <doug dot gregor at gmail dot com>, gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 6 Mar 2008 18:23:35 -0500
- Subject: Re: [C++0x PATCH] Remove auto as a storage class specifier
- References: <24b520d20802281347y38351b34i8a2cabd61d6c6e26@mail.gmail.com> <de8d50360802281352h640ebeb6oe271377f82eb8ccd@mail.gmail.com> <24b520d20802281420k6c570f6n10cc83589dce4ab8@mail.gmail.com> <de8d50360802281422t12cc576bwe8ad099244cb357f@mail.gmail.com> <29bd08b70803061509y2494dcdatd30708b5dad73de9@mail.gmail.com>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Thu, Mar 06, 2008 at 03:09:39PM -0800, Lawrence Crowl wrote:
> On 2/28/08, Andrew Pinski <pinskia@gmail.com> wrote:
> > On Thu, Feb 28, 2008 at 2:20 PM, Doug Gregor <doug.gregor@gmail.com> wrote:
> > > http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2337.pdf
> > >
> > > Basically, the use of "auto" as a storage specifier is pretty rare,
> > > and conflicts with the new meaning of "auto" in C++0x.
> >
> > So what if it is rare, it is breaking backwards compatibility even
> > more. They should have used a new keyword instead but then again
> > they know best, at least we hope they do.
>
> Adding a new keyword would in all probability have introduced a
> greater incompatibility than changing the meaning of auto because
> programmers weren't using that word. I did a code search for auto,
> and found 2/3 of all uses to be in compiler conformance tests.
E.g. in glibc (which is written in GNU C, not C++) auto keyword is used
heavily for nested function prototypes, to avoid warnings with
-Wmissing-prototypes.
void foo (void);
void foo (void)
{
// auto void bar (void);
void bar (void)
{
}
bar ();
}
results in warning, with auto void bar (void); there are no warnings.
Jakub