From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4423 invoked by alias); 31 Aug 2004 08:31: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 4408 invoked from network); 31 Aug 2004 08:31:15 -0000 Received: from unknown (HELO lon-mail-3.gradwell.net) (193.111.201.127) by sourceware.org with SMTP; 31 Aug 2004 08:31:15 -0000 Received: (qmail 6961 invoked from network); 31 Aug 2004 08:31:10 -0000 Received: from digraph.polyomino.org.uk (postmaster%pop3.polyomino.org.uk@81.187.227.50) by lon-mail-3.gradwell.net with SMTP; 31 Aug 2004 08:31:10 -0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.41) id 1C242n-000597-Pt; Tue, 31 Aug 2004 08:31:09 +0000 Date: Tue, 31 Aug 2004 09:11:00 -0000 From: "Joseph S. Myers" X-X-Sender: jsm28@digraph.polyomino.org.uk To: Richard Henderson cc: gcc@gcc.gnu.org Subject: Re: Undefined static functions In-Reply-To: <20040831050123.GA4683@redhat.com> Message-ID: References: <20040831050123.GA4683@redhat.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2004-08/txt/msg01594.txt.bz2 On Mon, 30 Aug 2004, Richard Henderson wrote: > On Tue, Aug 31, 2004 at 12:11:20AM +0000, Joseph S. Myers wrote: > > (b) Is there any reason this shouldn't be a hard error rather than just a > > pedwarn? > > The function implementation is contained within a file-scope asm. I need > to tell the compiler that the symbol is locally defined (static as opposed > to extern), so that the proper set of relocations are selected. > > I have used this often in kernel and libc code. This does rather make me wonder whether what check_global_declarations does after warning, /* This symbol is effectively an "extern" declaration now. */ TREE_PUBLIC (decl) = 1; is particularly safe. Certainly it looks like setting TREE_PUBLIC after pedwarning in the front end wouldn't be a particularly good way to stop check_global_declarations from warning - defining TREE_NO_WARNING to apply to decls as well as expressions looks safer. -- Joseph S. Myers http://www.srcf.ucam.org/~jsm28/gcc/ http://www.srcf.ucam.org/~jsm28/gcc/#c90status - status of C90 for GCC 3.5 jsm@polyomino.org.uk (personal mail) jsm28@gcc.gnu.org (Bugzilla assignments and CCs)