This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: We are nesting functions now?
- From: "Timothy J. Wood" <tjw at omnigroup dot com>
- To: kwall at kurtwerks dot com
- Cc: GCC List <gcc at gnu dot org>
- Date: Wed, 11 Dec 2002 22:00:16 -0800
- 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