We are nesting functions now?

Kris Warkentin kewarken@qnx.com
Thu Dec 12 06:49:00 GMT 2002


It's a gcc extension.  Probably in there for Pascal support.

http://gcc.gnu.org/onlinedocs/gcc-3.2/gcc/Nested-Functions.html#Nested%20Fun
ctions

cheers,

Kris
----- Original Message -----
From: "Timothy J. Wood" <tjw@omnigroup.com>
To: <kwall@kurtwerks.com>
Cc: "GCC List" <gcc@gnu.org>
Sent: Thursday, December 12, 2002 1:00 AM
Subject: Re: We are nesting functions now?


>
>
>    If you move the call to f3 so that it is in the proper scope, this
> works:
>
> % cc -Wall foo.c -o foo
> % ./foo
> F1
> F3
> F2
> % cc -v
> cc -v
> Reading specs from /usr/libexec/gcc/darwin/ppc/3.1/specs
> Thread model: posix
> Apple Computer, Inc. GCC version 1173, based on gcc version 3.1
> 20020420 (prerelease)
>
>
> #include <stdio.h>
> int  main() {
>      void fi() {
>          void f2() {
>              printf("F2\n");
>          }
>          void f3() {
>              printf("F3\n");
>              f2();
>          }
>          printf("F1\n");
>          f3();
>      }
>      fi();
>      return 1;
> }
>
> -tim
>
>



More information about the Gcc mailing list