This is the mail archive of the gcc-bugs@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: Today's source cannot build on NetBSD



  In message <200001071809.NAA15533@caip.rutgers.edu>you write:
  >  > From: Krister Walfridsson <cato at df dot lth dot se> 
  >  >       Date: Wed, 29 Dec 1999 23:09:59 +0100 (CET) 
  >  > 
  >  > ../../egcs/gcc/../include/libiberty.h:194: conflicting types for `vaspri
  > ntf'
  >  > /usr/include/stdio.h:348: previous declaration of `vasprintf'
  >  > 
  >  > The vasprintf in /usr/include/stdio.h is declared as
  >  > int      vasprintf __P((char **, const char *, _BSD_VA_LIST_))
  >  >                 __attribute__((__format__(__printf__, 2, 0)));
  >  >    /Krister
  > 
  > 
  > I don't have access to a netbsd system, but I notice that in
  > libiberty/vasprintf.c the function is declared as:
Nor do I anymore.  Though that might be changing in the not too distant
future.

  >  > int
  >  > vasprintf (result, format, args)
  >  >      char **result;
  >  >      const char *format;
  >  > #if defined (_BSD_VA_LIST_) && defined (__FreeBSD__)
  >  >      _BSD_VA_LIST_ args;
  >  > #else
  >  >      va_list args;
  >  > #endif
  > 
  > So perhaps it would be proper to declare it like that in the
  > libiberty.h header file?  Does netbsd define __FreeBSD__ ?
Possibly.  I doubt netbsd defines __FreeBSD__ though.  


  > If it does, can you or anyone explain why _BSD_VA_LIST_ exists?  Do
  > the other v*printf functions use it too?  What happens if you pass a
  > va_list to vasprintf?  I.e. can you compile gcc/f/{com.c,sts.c} ?
  > (Those files use vasprintf and pass it a va_list.)
It's the scheme that the *bsd* variants use to define things like va_list,
size_t and allow programs to determine if those typedefs are available.
It's pretty standard stuff across the bsd variants derived from 4.4 or
net2.



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