From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zack Weinberg To: obrien@NUXI.com Cc: rittle@rsch.comm.mot.com, morganw@engr.sc.edu, rth@cygnus.com, gcc@gcc.gnu.org, pfeifer@dbai.tuwien.ac.at Subject: Re: FreeBSD 4.0 Date: Thu, 30 Sep 1999 18:02:00 -0000 Message-ID: <199909151623.JAA02391@zack.bitmover.com> References: <199909150533.AAA14241@latour.rsch.comm.mot.com> <199909150601.XAA22053@zack.bitmover.com> <19990914231414.B17808@dragon.nuxi.com> <199909150726.AAA31243@zack.bitmover.com> <19990915011710.B25121@relay.nuxi.com> X-SW-Source: 1999-09n/msg00630.html Message-ID: <19990930180200.v-Air64Uv6oq5-vobBdNTNjUvVDjn_0R6FH_yzvq3GQ@z> "David O'Brien" wrote: > > Because the "real" type is __gnuc_va_list. Doing it your way won't do > > what you want. I hope you don't have system headers that typedef > > _BSD_VA_LIST_ without reference to gcc's stdarg.h - > > from /usr/include/machine/ansi.h > > #define _BSD_VA_LIST_ char * /* va_list */ > > There are no GCC headers in my base system. We've never needed them, and > there are copyright issues anyway. Do you have your own stdarg.h too? This definition will not work with the new stdarg scheme. gcc's stdarg.h does #ifndef __GNUC_VA_LIST #define __GNUC_VA_LIST typedef __builtin_va_list __gnuc_va_list; #endif __builtin_va_list is an opaque type which may be 'char *' deep inside, but won't be compatible in the C sense with 'char *'. Since it's a #define not a typedef, we can work around it: #ifdef _BSD_VA_LIST_ #undef _BSD_VA_LIST_ #define _BSD_VA_LIST_ __gnuc_va_list #endif but that requires us to get machine/ansi.h included by stdarg.h. Since that header is BSD specific, we go back to needing some automatically defined macro that can be tested. And I'm sorry, but Andreas is right, we cannot use 'BSD'. Suppose stdarg.h is the very first header included by a user program. Only the macros predefined by the compiler are available, and those don't include BSD. (It has nothing to do with -ansi.) gcc's stddef.h has the same problem and is using /* On 4.3bsd-net2, make sure ansi.h is included, so we have one less case to deal with in the following. */ #if defined __BSD_NET2__ || defined ____386BSD____ \ || defined __FreeBSD__ || defined __NetBSD__ #include #endif which looks pretty safe modulo the absence of __OpenBSD__... I'd like to know what machine/ansi.h does on Alphas, where "char *" doesn't work for va_list. zw