This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: (printf) ("hello world\n");
- From: Geoff Keating <geoffk at geoffk dot org>
- To: mec dot gnu at mindspring dot com (Michael Elizabeth Chastain)
- Cc: gcc at gcc dot gnu dot org
- Date: 09 Dec 2003 15:43:12 -0800
- Subject: Re: (printf) ("hello world\n");
- References: <20031209204037.906D84B412@berman.michael-chastain.com>
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 <stdio.h>" 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 <geoffk@geoffk.org>