This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Gcc 3.0, printf() and exim-3.30


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]