This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]