c/4101: gcc 2.95.4 compiles bad code with nested static functions

Bernd Schmidt bernds@redhat.com
Fri Aug 24 03:37:00 GMT 2001


On Fri, 24 Aug 2001, cristiano wrote:

> > Basically, f1 is treated as a local variable, and you
> > can't keep pointers to those across multiple calls to a function either.
> >
> >
> > Bernd
>
> thank you.
> i've now declared f1 and f2 as STATIC.
> the problem remains... if they're now static, the code should be valid now,
> shouldn't it??

I had to make an experiment - apparently "static" is completely ignored
for nested functions.  Let me repeat: don't use them.  They are one of
the more vile GNU extensions.

> tell me is something illuding you, sunshine?

"eluding" :)


Bernd



More information about the Gcc-bugs mailing list