GCC complains about nested functions despite none being present

Ian Lance Taylor via gcc-help gcc-help@gcc.gnu.org
Sun Jun 25 18:47:00 GMT 2017


On Sun, Jun 25, 2017 at 11:41 AM, Maxim Blinov <maxim.a.blinov@gmail.com> wrote:
>
> However, what is a static chain pointer exactly? After some reading, I
> understand it to be used for retrieving locals from the caller's
> frame, but how would this functionality be relevant to C?

GCC supports nested functions as a C extension.
https://gcc.gnu.org/onlinedocs/gcc-7.1.0/gcc/Nested-Functions.html#Nested-Functions
.

I don't know why you get the error in code that doesn't use static
functions.  It may be a minor bug--an unnecessary call to to the
static_chain hook.

Ian



More information about the Gcc-help mailing list