From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23142 invoked by alias); 1 Dec 2004 17:38:28 -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 22649 invoked from network); 1 Dec 2004 17:38:18 -0000 Received: from unknown (HELO mail2.codesourcery.com) (66.160.135.55) by sourceware.org with SMTP; 1 Dec 2004 17:38:18 -0000 Received: (qmail 4879 invoked from network); 1 Dec 2004 17:38:18 -0000 Received: from support.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.10) by mail2.codesourcery.com with SMTP; 1 Dec 2004 17:38:18 -0000 Received: (qmail 9563 invoked from network); 1 Dec 2004 17:38:18 -0000 Received: from localhost (HELO taltos.codesourcery.com) (zack@127.0.0.1) by mail.codesourcery.com with SMTP; 1 Dec 2004 17:38:18 -0000 Received: by taltos.codesourcery.com (sSMTP sendmail emulation); Wed, 1 Dec 2004 09:38:17 -0800 To: "Joseph S. Myers" Cc: "James A. Morrison" , gcc@gcc.gnu.org Subject: Re: Static nested functions References: <87653mlbax.fsf@codesourcery.com> From: Zack Weinberg Date: Wed, 01 Dec 2004 17:38:00 -0000 In-Reply-To: (Joseph S. Myers's message of "Wed, 1 Dec 2004 11:05:33 +0000 (UTC)") Message-ID: <87wtw1kjg6.fsf@codesourcery.com> User-Agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2004-12/txt/msg00062.txt.bz2 "Joseph S. Myers" writes: > On Tue, 30 Nov 2004, Zack Weinberg wrote: > >> Suggest trying csc_extern instead of csc_auto; that might get more >> sensible error-recovery behavior. > > I'd concur, and also add that this should make the code in pushdecl > > /* Similarly, a declaration of a function with static linkage at > block scope must be checked against any existing declaration > of that function at file scope. */ > else if (TREE_CODE (x) == FUNCTION_DECL && scope != file_scope > && !TREE_PUBLIC (x) && !DECL_INITIAL (x)) > { > ... > > unreachable, so it should be replaced by an assert good point ... > (with appropriate tests for static declarations at block scope with > extern and static ones at file scope, and for auto declarations at > block scope which should shadow outer static or extern declarations > with the same name, and that auto declarations or nested function > definitions with implied auto conflict with extern declarations at > the same scope but not with other auto declarations at the same > scope). I can't parse this sentence; is it just a list of appropriate tests? If so, would you be willing to implement such a test and file a 4.1- target PR? zw