Sylvestre Ledru <sylves...@debian.org> writes:

> > > Nested functions are NOT part of the C and C++ standard:
> > > http://en.wikipedia.org/wiki/Nested_function#Languages
> > >
> > > The gcc support is a mistake.
> > 
> > "Nested functions" is an official GCC extension:
> > 
> > https://gcc.gnu.org/onlinedocs/gcc-4.9.0/gcc/Nested-Functions.html
> 
> Yes. It has been implemented as a side effect of the ADA support in gcc
> (just like Variable Length Array).

That may be the historical reason for its existence, but, for as long as
it is documented, it is an officially supported extension by GCC.

> It is not because gcc supports it that it is standard C...

This is true, it is not standard C; ANSI or otherwise.

> Arthur's patch is doing the correct implementation (static function in
> the same object file).

The "correct" implementation?  We have, in our program, chosen to use
many non-standardized extensions: We use Linux-specific features and not
only those of the POSIX kernel functions.  We use GLibc-specific
features and not only those of the POSIX standard library.  We also, as
you have noticed, use features specific to GCC and not only those of the
ANSI C standard.  Is this not "correct"?

/Teddy Hogeborn

-- 
The Mandos Project
http://www.recompile.se/mandos

Attachment: pgpJPoqEpf312.pgp
Description: PGP signature

Reply via email to