This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
public and extern
- From: Anders Ãdland <aaadland at atmel dot no>
- To: gcc at gcc dot gnu dot org
- Cc: Anders Ãdland <andersa at tiscali dot no>
- Date: Tue, 29 Jul 2003 16:28:55 +0200
- Subject: public and extern
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