Local binding DECLs

Stephen Biggs xyzzy@hotpop.com
Mon May 12 06:41:00 GMT 2003


On Mon, 2003-05-12 at 04:13, Richard Henderson wrote:
> On Sun, May 11, 2003 at 10:04:20AM +0300, Stephen Biggs wrote:
> > Ok... is there ANY way to find out if the FUNCTION_DECL I am handed at
> > any time (preferably in ENCODE_SECTION) is declared in a function block
> > as opposed to globally?
> 
> *Declared*?  I.e. to distinguish
> 
> 	extern void foo();
> 	void bar() { foo(); }
> 
> from 
> 
> 	void bar() {
> 	  extern void foo();
> 	  foo();
> 	}
> 
> Absolutely not.  That question doesn't even make sense.
> 
> 
> r~
> 
Sure it does, if you have, for example:

void bar() {
  static void foo();
  foo();
}

void bar1() {
  static int foo();
  foo();
}

void bar2() {
  static int foo(int);
  int a = foo(3);
}
foo() {}

This compiles.

I see nothing that gives me the ability to know that any particular DECL
is declared inside a particular function.

Perhaps someone might need to write different code or do something else
different per function based on the local declarations?  Does THIS make
sense?




More information about the Gcc mailing list