Re: Scope of specifier extern
- From: "Tom St Denis" <tomstdenis@xxxxxxxxx>
- Date: 30 Jun 2006 05:47:49 -0700
Christian Christmann wrote:
That's the point. I figured out that GCC is considering both 'e' as one
and the same object. However, I don't know if this strictly corresponds
to ANSI C-99.
I don't see why not. I mean from an implementation point of view
"extern int e" just means use the symbol defined globally somewhere
else. The fact that "somewhere else" is within the same object file
doesn't really matter.
It's similar in concept to a forward declaration, e.g.
int somefunc(int);
int myfunc(int x) { return somefunc(x); }
int somefunc(int x) { return x + 1; }
You could also write it as
int myfunc(int x) { extern int somefunc(int); return somefunc(x); }
int somefunc(int x) { return x + 1; }
"gcc -pedantic --std=c99 -O2 -Wall -W"
Doesn't raise a single diagnostic at that. :-)
Tom
.
- References:
- Scope of specifier extern
- From: Christian Christmann
- Re: Scope of specifier extern
- From: Tom St Denis
- Re: Scope of specifier extern
- From: Christian Christmann
- Scope of specifier extern
- Prev by Date: Re: Order of execution
- Next by Date: Re: qsort() results: implementation dependent?
- Previous by thread: Re: Scope of specifier extern
- Next by thread: Re: Scope of specifier extern
- Index(es):
Relevant Pages
|