This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Gcc 3.0, printf() and exim-3.30
- To: gcc at gcc dot gnu dot org
- Subject: Re: Gcc 3.0, printf() and exim-3.30
- From: Daniel Jacobowitz <dmj+ at andrew dot cmu dot edu>
- Date: Wed, 20 Jun 2001 23:31:14 -0700
- References: <20010619161158.F9339@vygo.net> <87bsnihitd.fsf@loki.wkstn.nix>
On Wed, Jun 20, 2001 at 11:45:18PM +0100, Nix wrote:
> On Tue, 19 Jun 2001, Vadim Vygonets stipulated:
> > A macro? True?
>
> Looks legal to me...
>
> >> gcc -c -DNOPOSIX -O pcretest.c
> >> pcretest.c:474:1: directives may not be used inside a macro argument
>
> Correct, but not relevant to this situation, I think.
>
> > The code in question reads:
> >
> > printf(" -d debug: show compiled code; implies -i\n"
> > " -i show information about compiled pattern\n"
> > #if !defined NOPOSIX
> > " -p use POSIX interface\n"
> > #endif
> > " -s output store information\n"
> > " -t time compilation and execution\n");
> >
> > It looks as if gcc 3.0 has printf defined as a macro. IMHO this is
> > lunacy.
>
> Nope; printf is not a macro, and GCC does not define printf :)
No, you're wrong. Recent versions of the GNU C Library define printf
as a macro. I'm not sure that gcc 2.95 always flagged the use of
preprocessor directives inside the arguments of a macro as an error,
but it certainly is within its rights to, just as the library is within
its rights to make printf into a macro.
> This will, of course, do nothing; GCC does not define a printf macro,
> and I hope that exim doesn't :) Defining printf is definitely the job of
> the libc :)
Precisely. The libc does it.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer