From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24105 invoked by alias); 9 Dec 2003 23:43:55 -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 24002 invoked from network); 9 Dec 2003 23:43:54 -0000 Received: from unknown (HELO desire.geoffk.org) (24.6.229.131) by sources.redhat.com with SMTP; 9 Dec 2003 23:43:54 -0000 Received: (from geoffk@localhost) by desire.geoffk.org (8.11.6/8.11.6) id hB9NhCK29680; Tue, 9 Dec 2003 15:43:12 -0800 X-Authentication-Warning: desire.geoffk.org: geoffk set sender to geoffk@geoffk.org using -f To: mec.gnu@mindspring.com (Michael Elizabeth Chastain) CC: gcc@gcc.gnu.org Subject: Re: (printf) ("hello world\n"); References: <20031209204037.906D84B412@berman.michael-chastain.com> From: Geoff Keating Date: Tue, 09 Dec 2003 23:56:00 -0000 In-Reply-To: <20031209204037.906D84B412@berman.michael-chastain.com> Message-ID: User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2003-12/txt/msg00603.txt.bz2 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). (I think Dale answered the question you really wanted to ask.) -- - Geoffrey Keating