From 49a2cf8f211213712d452287ae8e121cf59e3178 Mon Sep 17 00:00:00 2001 From: David Lawrence Date: Tue, 6 Jun 2000 00:44:07 +0000 Subject: [PATCH] quiet va_start() warnings on BSD/OS 4.1 --- acconfig.h | 18 ++++++++++++++++++ config.h.in | 18 ++++++++++++++++++ configure | 11 ++++++++++- configure.in | 8 +++++++- 4 files changed, 53 insertions(+), 2 deletions(-) diff --git a/acconfig.h b/acconfig.h index 5ce99df089..659d903863 100644 --- a/acconfig.h +++ b/acconfig.h @@ -62,3 +62,21 @@ struct __sFILE; extern __inline int __sputaux(int _c, struct __sFILE *_p); #endif + +/* Shut up warnings from gcc -Wcast-qual on BSD/OS 4.1. */ +#undef SHUTUP_STDARG_CAST +#if defined(SHUTUP_STDARG_CAST) && defined(__GNUC__) +#include /* Grr. Must be included *every time*. */ +/* + * The silly continuation line is to keep configure from + * commenting out the #undef. + */ +#undef \ + va_start +#define va_start(ap, last) \ + do { \ + union { const void *konst; long *var; } _u; \ + _u.konst = &(last); \ + ap = (va_list)(_u.var + __va_words(__typeof(last))); \ + } while (0) +#endif /* SHUTUP_STDARG_CAST && __GNUC__ */ diff --git a/config.h.in b/config.h.in index 71ec61f107..07b813e204 100644 --- a/config.h.in +++ b/config.h.in @@ -70,6 +70,24 @@ struct __sFILE; extern __inline int __sputaux(int _c, struct __sFILE *_p); #endif +/* Shut up warnings from gcc -Wcast-qual on BSD/OS 4.1. */ +#undef SHUTUP_STDARG_CAST +#if defined(SHUTUP_STDARG_CAST) && defined(__GNUC__) +#include /* Grr. Must be included *every time*. */ +/* + * The silly continuation line is to keep configure from + * commenting out the #undef. + */ +#undef \ + va_start +#define va_start(ap, last) \ + do { \ + union { const void *konst; long *var; } _u; \ + _u.konst = &(last); \ + ap = (va_list)(_u.var + __va_words(__typeof(last))); \ + } while (0) +#endif /* SHUTUP_STDARG_CAST && __GNUC__ */ + /* Define if you have the header file. */ #undef HAVE_FCNTL_H diff --git a/configure b/configure index e55941af27..9faad47bed 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh -# From configure.in Revision: 1.142 +# From configure.in Revision: 1.143 @@ -3876,6 +3876,15 @@ case "$host" in EOF ;; + *-bsdi4.1*) + # + # Shut up a -Wcast-qual warning from va_start(). + # + cat >> confdefs.h <<\EOF +#define SHUTUP_STDARG_CAST 1 +EOF + + ;; esac # diff --git a/configure.in b/configure.in index a6846a6813..1b450e78be 100644 --- a/configure.in +++ b/configure.in @@ -13,7 +13,7 @@ dnl PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS dnl ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS dnl SOFTWARE. -AC_REVISION($Revision: 1.142 $) +AC_REVISION($Revision: 1.143 $) AC_PREREQ(2.13) @@ -843,6 +843,12 @@ case "$host" in # AC_DEFINE(SHUTUP_SPUTAUX) ;; + *-bsdi4.1*) + # + # Shut up a -Wcast-qual warning from va_start(). + # + AC_DEFINE(SHUTUP_STDARG_CAST) + ;; esac #