From: Jim Wilson Date: Wed, 23 Mar 1994 22:20:35 +0000 (-0800) Subject: (va_start): Add call to builtin_next_arg. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a20dcf46c04b7bc8533b3e6c6a040c9f7083e6e6;p=gcc.git (va_start): Add call to builtin_next_arg. From-SVN: r6856 --- diff --git a/gcc/ginclude/va-alpha.h b/gcc/ginclude/va-alpha.h index 0cc11093109..75cd6cd327c 100644 --- a/gcc/ginclude/va-alpha.h +++ b/gcc/ginclude/va-alpha.h @@ -35,8 +35,11 @@ typedef struct { /* ANSI alternative. */ -#define va_start(pvar, firstarg) \ - ((pvar) = *(__gnuc_va_list *) __builtin_saveregs ()) +/* Call __builtin_next_arg even though we aren't using its value, so that + we can verify that firstarg is correct. */ +#define va_start(pvar, firstarg) \ + (__builtin_next_arg (firstarg), \ + (pvar) = *(__gnuc_va_list *) __builtin_saveregs ()) #endif /* _STDARG_H */ diff --git a/gcc/ginclude/va-clipper.h b/gcc/ginclude/va-clipper.h index e3a4b8f6e53..a6d000ef5a3 100644 --- a/gcc/ginclude/va-clipper.h +++ b/gcc/ginclude/va-clipper.h @@ -22,9 +22,12 @@ typedef struct #define _VA_LIST_ #define _SYS_INT_STDARG_H /* acc compatibility */ +/* Call __builtin_next_arg even though we aren't using its value, so that + we can verify that LASTARG is correct. */ #ifdef _STDARG_H #define va_start(AP,LASTARG) \ - ((AP) = *(va_list *)__builtin_saveregs(), \ + (__builtin_next_arg (LASTARG), \ + (AP) = *(va_list *)__builtin_saveregs(), \ (AP).__va_num = __builtin_args_info (0), \ (AP).__va_ap += __builtin_args_info (1)) #else diff --git a/gcc/ginclude/va-m88k.h b/gcc/ginclude/va-m88k.h index 243d65354ae..480fef08d2a 100644 --- a/gcc/ginclude/va-m88k.h +++ b/gcc/ginclude/va-m88k.h @@ -19,8 +19,12 @@ typedef struct #ifdef _STDARG_H /* stdarg.h support */ +/* Call __builtin_next_arg even though we aren't using its value, so that + we can verify that LASTARG is correct. */ #if __GNUC__ > 1 /* GCC 2.0 and beyond */ -#define va_start(AP,LASTARG) ((AP) = *(__gnuc_va_list *)__builtin_saveregs()) +#define va_start(AP,LASTARG) \ + (__builtin_next_arg (LASTARG), \ + (AP) = *(__gnuc_va_list *)__builtin_saveregs()) #else #define va_start(AP,LASTARG) \ ( (AP).__va_reg = (int *) __builtin_saveregs2(0), \ diff --git a/gcc/ginclude/va-pa.h b/gcc/ginclude/va-pa.h index 14c6b959a00..b21c1e4aca9 100644 --- a/gcc/ginclude/va-pa.h +++ b/gcc/ginclude/va-pa.h @@ -21,8 +21,11 @@ typedef double *__gnuc_va_list; (AP) = (double *)((char *)(AP) + 4) #endif /* __GNUC__ > 1 */ +/* Call __builtin_next_arg even though we aren't using its value, so that + we can verify that LASTARG is correct. */ #ifdef _STDARG_H -#define va_start(AP,LASTARG) __gnuc_va_start (AP) +#define va_start(AP,LASTARG) \ + (__builtin_next_arg (LASTARG), __gnuc_va_start (AP)) #else /* The ... causes current_function_varargs to be set in cc1. */ #define va_dcl long va_alist; __va_ellipsis