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]
Other format: [Raw text]

Re: Autoconf 2.59 breaks libstdc++ checks


On Thu, May 06, 2004 at 01:09:07AM +0200, Andreas Schwab wrote:
> Kean Johnston <jkj@sco.com> writes:
> 
> > The problem is the new code there does a #undef $1. This is
> > what is breaking things, and its wrong. It is a perfectly
> > valid thing for an OS to use #define to implement some function
> > in terms of another.
> 
> But unless stated otherwise, all functions in the C library are also
> required to be provided as indentifiers with external linkage.

  What about getc, putc and putchar from stdio? The man page from FreeBSD
  states these are macros. I am getting linker errors because libstdc++.a
  has references to getc/putc but both exist as macro only (an ANSI/ISO C
  library on AmigaOS). A similiar problem exists with putchar which is also
  only available as a macro but GCC 3.3 or later might generate code that
  references it.
  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.

  Gunther


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