From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7446 invoked by alias); 10 Dec 2003 13:36:58 -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 7437 invoked from network); 10 Dec 2003 13:36:56 -0000 Received: from unknown (HELO lon-mail-1.gradwell.net) (193.111.201.125) by sources.redhat.com with SMTP; 10 Dec 2003 13:36:56 -0000 Received: (qmail 66005 invoked from network); 10 Dec 2003 13:36:54 -0000 Received: from digraph.polyomino.org.uk (postmaster%pop3.polyomino.org.uk@81.187.227.50) by lon-mail-1.gradwell.net with SMTP; 10 Dec 2003 13:36:54 -0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.30) id 1AU4WM-0000Di-O1; Wed, 10 Dec 2003 13:36:54 +0000 Date: Wed, 10 Dec 2003 14:08:00 -0000 From: "Joseph S. Myers" X-X-Sender: jsm28@digraph.polyomino.org.uk To: Segher Boessenkool cc: Robert Dewar , gcc@gcc.gnu.org, Eyal Lebedinsky , Andreas Schwab , Michael Elizabeth Chastain Subject: Re: (printf) ("hello world\n"); In-Reply-To: Message-ID: References: <20031209204037.906D84B412@berman.michael-chastain.com> <3FD6DD9B.E35C742@eyal.emu.id.au> <3FD71140.2070506@gnat.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2003-12/txt/msg00627.txt.bz2 On Wed, 10 Dec 2003, Segher Boessenkool wrote: > On 10-dec-03, at 13:27, Robert Dewar wrote: > > Is it really true that the name printf is reserved? Is a C program not > > allowed to define its own printf function (which might or might not be > > varargs)? What's the story here? > > It is reserved only in translation units that have stdio.h #include'd. It is reserved (in a hosted environment) as an identifier with external linkage regardless of what headers are included (7.1.3#1). If is included then it is alse reserved as a macro name (which however you may #undef) and as an identifier with file scope. (C94 reserved certain identifiers with external linkage iff the corresponding header was included in _any translation unit in the program_. This was not carried forward into C99; the functions added in C94 are now unconditionally reserved as identifiers with external linkage regardless of the headers included.) -- Joseph S. Myers jsm@polyomino.org.uk