Autoconf 2.59 breaks libstdc++ checks

Gunther Nikl gni@gecko.de
Thu May 6 12:40:00 GMT 2004


On Thu, May 06, 2004 at 02:21:52PM +0200, Andreas Schwab wrote:
> Gunther Nikl <gni@gecko.de> writes:
> 
> >   What about getc, putc and putchar from stdio?
> 
> The C standard says that they are functions.  The only difference to other
> functions is that getc and putc are allowed to evaluate the second
> argument twice when implemented as macro.  But they must still be
> available as normal functions as well.

  Thats what I wanted to know, thank you.

> >   BTW, is it legal to implement these macros as functions using the macros
> >   itself?
> >
> >     #include <stdio.h>
> >     int (getc)(FILE *stream) { return getc(stream); }
> >
> >   This will break if getc isn't a macro.
> 
> Undefined behaviour.  You are not allowed to redefine standard functions.

  I wasn't talking about user code but about the library code where the
  function has to be implemented. Would it be possible to it like that?
  Do I have to #undef the function name or is using () to prevent macro
  expansion fine?

  Gunther



More information about the Gcc mailing list