/* 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 */
#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
#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), \
(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