From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23357 invoked by alias); 10 Dec 2003 14:19:26 -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 23346 invoked from network); 10 Dec 2003 14:19:25 -0000 Received: from unknown (HELO Cantor.suse.de) (195.135.220.2) by sources.redhat.com with SMTP; 10 Dec 2003 14:19:25 -0000 Received: from Hermes.suse.de (Hermes.suse.de [195.135.221.8]) (using TLSv1 with cipher EDH-RSA-DES-CBC3-SHA (168/168 bits)) (No client certificate requested) by Cantor.suse.de (Postfix) with ESMTP id 814F118CF7AF; Wed, 10 Dec 2003 15:15:07 +0100 (CET) Received: by sykes.suse.de (Postfix, from userid 597) id EAAA1138873A7; Wed, 10 Dec 2003 15:15:00 +0100 (CET) To: Segher Boessenkool Cc: "Joseph S. Myers" , Michael Elizabeth Chastain , Robert Dewar , gcc@gcc.gnu.org, Eyal Lebedinsky Subject: Re: (printf) ("hello world\n"); References: <20031209204037.906D84B412@berman.michael-chastain.com> <3FD6DD9B.E35C742@eyal.emu.id.au> <3FD71140.2070506@gnat.com> <4F621C55-2B1A-11D8-8ABB-000A95A4DC02@kernel.crashing.org> From: Andreas Schwab X-Yow: Just to have MORE FUN, I'll pretend I am JAMES CAGNEY and I am having a tense, UP-TIGHT EXPERIENCE!! Date: Wed, 10 Dec 2003 15:55:00 -0000 In-Reply-To: <4F621C55-2B1A-11D8-8ABB-000A95A4DC02@kernel.crashing.org> (Segher Boessenkool's message of "Wed, 10 Dec 2003 15:08:20 +0100") Message-ID: User-Agent: Gnus/5.1002 (Gnus v5.10.2) Emacs/21.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-SW-Source: 2003-12/txt/msg00630.txt.bz2 Segher Boessenkool writes: > On 10-dec-03, at 14:36, Joseph S. Myers wrote: >> 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). > > That does not prevent you from declaring and defining your own > printf() function (with a different prototype) though; it only requires > that you make that function have external linkage. Which requires that you declare it in the first place, otherwise it will have implicitly external linkage. Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux AG, Maxfeldstraße 5, 90409 Nürnberg, Germany Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."