(va_start): Add call to builtin_next_arg.
authorJim Wilson <wilson@gcc.gnu.org>
Wed, 23 Mar 1994 22:20:35 +0000 (14:20 -0800)
committerJim Wilson <wilson@gcc.gnu.org>
Wed, 23 Mar 1994 22:20:35 +0000 (14:20 -0800)
From-SVN: r6856

gcc/ginclude/va-alpha.h
gcc/ginclude/va-clipper.h
gcc/ginclude/va-m88k.h
gcc/ginclude/va-pa.h

index 0cc11093109a99bce3b7ce3647589d20681881cb..75cd6cd327c9c8f08c4d383707e0647bdb05bb72 100644 (file)
@@ -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 */
 
index e3a4b8f6e536585bca3cfa04d612776902b356d2..a6d000ef5a32fdf511d4428b25a1b87a4d46dd73 100644 (file)
@@ -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
index 243d65354ae77ca45566f173b8bd3058f3302932..480fef08d2a504ddff41404196982c738d94f9f6 100644 (file)
@@ -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), \
index 14c6b959a008e3f2a11577ea1320076c33a3709d..b21c1e4aca91081993b65fe497208724cb955744 100644 (file)
@@ -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