public and extern

Anders Ådland aaadland@atmel.no
Tue Jul 29 14:35:00 GMT 2003


My assembler needs an "extern" for each symbol reference which is 
referenced in the compilation but not defined. It also needs a "public" to 
make symbols public to other files. It don't, however, handle using both 
"extern" and "public" on the same symbol.

In the test program

static __inline__ int f() { return g(); }
int g() { return f(); }

g() is marked "extern" before printing the f() function body, but also 
marked "public" when its body is defined. How can I make GCC drop the 
"extern" when the function body is defined later in the file?

The answer is probably in ASM_OUTPUT_EXTERNAL. I have tryed to use the decl 
argument, which is the tree node for the declaration, but didn't find the 
answer.

Anders



More information about the Gcc mailing list