From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13007 invoked by alias); 10 Dec 2003 08:47:27 -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 13000 invoked from network); 10 Dec 2003 08:47:25 -0000 Received: from unknown (HELO gizmo05ps.bigpond.com) (144.140.71.15) by sources.redhat.com with SMTP; 10 Dec 2003 08:47:25 -0000 Received: (qmail 24346 invoked from network); 10 Dec 2003 08:42:42 -0000 Received: from unknown (HELO psmam07.bigpond.com) (144.135.25.87) by gizmo05ps.bigpond.com with SMTP; 10 Dec 2003 08:42:42 -0000 Received: from cpe-203-51-31-164.nsw.bigpond.net.au ([203.51.31.164]) by psmam07.bigpond.com(MAM REL_3_4_2 125/5118740) with SMTP id 5118740; Wed, 10 Dec 2003 18:47:23 +1000 Message-ID: <3FD6DD9B.E35C742@eyal.emu.id.au> Date: Wed, 10 Dec 2003 09:53:00 -0000 From: Eyal Lebedinsky Organization: Eyal at Home X-Accept-Language: en MIME-Version: 1.0 To: gcc@gcc.gnu.org CC: Michael Elizabeth Chastain Subject: Re: (printf) ("hello world\n"); References: <20031209204037.906D84B412@berman.michael-chastain.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2003-12/txt/msg00616.txt.bz2 Geoff Keating wrote: > > mec.gnu@mindspring.com (Michael Elizabeth Chastain) writes: > > > I have a language lawyer question. > > > > int main () > > { > > (printf) ("hello world\n"); > > return 0; > > } > > > > Is this a conforming C program? > > > > There is no "#include " so there is no declaration > > in scope for printf. > > This would be nonconforming even if it was > > int main() > { > printf ("hello world\n"); > } > > since printf is a varargs function and so must be prototyped before it > is called (ISO C 6.5.2.2 paragraph 6). But without the varargs attribute is not present and all is well. Naturally, it may very well fail to execute correctly, but this is not the issue here. -- Eyal Lebedinsky (eyal@eyal.emu.id.au)