Re: [Exim] Doesn't build with GCC 3.0 (was Re: Release of Ex…

Startseite
Nachricht löschen
Nachricht beantworten
Autor: Philip Hazel
Datum:  
To: Frédéric L. W. Meunier
CC: exim-users
Betreff: Re: [Exim] Doesn't build with GCC 3.0 (was Re: Release of Exim 3.30)
On Tue, 19 Jun 2001, Frédéric L. W. Meunier wrote:

> Exim 3.30 doesn't build with GCC 3.0:
>
> gcc -c -DNOPOSIX -O pcretest.c
> pcretest.c:474:1: directives may not be used inside a macro argument


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.

Try inserting

#undef printf

immediately before that statement, and see if it makes it work. (The C
standard requires all standard functions to be available as functions,
even if they are also defined as macros.)

If that doesn't work, well, I suppose the thing can be rewritten so as
to duplicate the text in the source. What an annoying restriction.

There may be other places in the source where I have done this. What do
the C style gurus on this list think? Is it an unreasonable thing to do?

-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.