From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2400 invoked by alias); 12 May 2003 06:41:18 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 2325 invoked from network); 12 May 2003 06:41:17 -0000 Received: from unknown (HELO babyruth.hotpop.com) (204.57.55.14) by sources.redhat.com with SMTP; 12 May 2003 06:41:17 -0000 Received: from hotpop.com (kubrick.hotpop.com [204.57.55.16]) by babyruth.hotpop.com (Postfix) with SMTP id EDA8A21C9BC for ; Mon, 12 May 2003 06:41:09 +0000 (UTC) Received: from steve.softier.local (unknown [62.90.245.250]) by smtp-1.hotpop.com (Postfix) with ESMTP id D5EB81A0144 for ; Mon, 12 May 2003 06:41:05 +0000 (UTC) Subject: Re: Local binding DECLs From: Stephen Biggs To: GCC list In-Reply-To: <20030512011324.GA15787@redhat.com> References: <1052394173.13089.7.camel@steve.softier.local> <20030508220157.GE6901@redhat.com> <1052636662.18831.1.camel@steve.softier.local> <20030512011324.GA15787@redhat.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Mon, 12 May 2003 06:41:00 -0000 Message-Id: <1052721885.2480.8.camel@steve.softier.local> Mime-Version: 1.0 X-HotPOP: ----------------------------------------------- Sent By HotPOP.com FREE Email Get your FREE POP email at www.HotPOP.com ----------------------------------------------- X-SW-Source: 2003-05/txt/msg01087.txt.bz2 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?