void va_end (__gnuc_va_list); /* Defined in libgcc.a */
#define va_end(AP)
+/* We cast to void * and then to TYPE * because this avoids
+ a warning about increasing the alignment requirement. */
#define va_arg(AP, TYPE) \
(AP = (char *) (AP) + __va_rounded_size (TYPE), \
- *((TYPE *) ((char *) (AP) - __va_rounded_size (TYPE))))
+ *((TYPE *) (void *) ((char *) (AP) - __va_rounded_size (TYPE))))
#endif /* _STDARG_H */
#endif /* not alpha */
#define va_start(AP) ((AP)[1] = 0, *(AP) = (unsigned) &va_alist)
#endif
+/* We cast to void * and then to TYPE * because this avoids
+ a warning about increasing the alignment requirement. */
#define va_arg(AP, T) \
( \
( \
: ((AP)[1] = __vpad ((AP)[1], T)) \
), \
\
- *((T *) ((char *) *(AP) + (AP)[1] - __vsiz (T))) \
+ *((T *) (void *) ((char *) *(AP) + (AP)[1] - __vsiz (T))) \
)
void va_end (__gnuc_va_list); /* Defined in libgcc.a */
#define __va_size(TYPE) ((sizeof(TYPE) + 3) >> 2)
-#define va_arg(AP,TYPE) \
+/* We cast to void * and then to TYPE * because this avoids
+ a warning about increasing the alignment requirement. */
+#define va_arg(AP,TYPE) \
( (AP).__va_arg = (((AP).__va_arg + (1 << (__alignof__(TYPE) >> 3)) - 1) \
- & ~((1 << (__alignof__(TYPE) >> 3)) - 1)) \
- + __va_size(TYPE), \
- *((TYPE *) ((__va_reg_p(TYPE) && (AP).__va_arg < 8 + __va_size(TYPE) \
- ? (AP).__va_reg : (AP).__va_stk) \
- + ((AP).__va_arg - __va_size(TYPE)))))
+ & ~((1 << (__alignof__(TYPE) >> 3)) - 1)) \
+ + __va_size(TYPE), \
+ *((TYPE *) (void *) ((__va_reg_p(TYPE) \
+ && (AP).__va_arg < 8 + __va_size(TYPE) \
+ ? (AP).__va_reg : (AP).__va_stk) \
+ + ((AP).__va_arg - __va_size(TYPE)))))
#define va_end(AP)
#define va_arg(list, mode) ((mode *)(list += __va_rounded_size(mode)))[-1]
#else /* !lint */
-#define va_arg(__AP, __type) \
- ((__type *)(__AP = (char *) ((__alignof(__type) > 4 \
- ? ((int)__AP + 8 - 1) & -8 \
- : ((int)__AP + 4 - 1) & -4) \
- + __va_rounded_size(__type))))[-1]
+/* We cast to void * and then to TYPE * because this avoids
+ a warning about increasing the alignment requirement. */
+#define va_arg(__AP, __type) \
+ ((__type *) (void *) (__AP = (char *) ((__alignof(__type) > 4 \
+ ? ((int)__AP + 8 - 1) & -8 \
+ : ((int)__AP + 4 - 1) & -4) \
+ + __va_rounded_size(__type))))[-1]
#endif /* lint */
#endif /* defined (_STDARG_H) || defined (_VARARGS_H) */
#define va_arg(AP,TYPE) \
(sizeof(TYPE) > 8 ? \
((AP = (__gnuc_va_list) ((char *)AP - sizeof (int))), \
- (*((TYPE *) (*((int *) (AP)))))) \
+ (*((TYPE *) (void *) (*((int *) (AP)))))) \
:((AP = \
(__gnuc_va_list) ((long)((char *)AP - sizeof (TYPE)) \
& (sizeof(TYPE) > 4 ? ~0x7 : ~0x3))), \
- (*((TYPE *) ((char *)AP + ((8 - sizeof(TYPE)) % 4))))))
+ (*((TYPE *) (void *) ((char *)AP + ((8 - sizeof(TYPE)) % 4))))))
#define va_end(AP)
#define __extension__
#endif
+/* We cast to void * and then to TYPE * because this avoids
+ a warning about increasing the alignment requirement. */
#define va_arg(_AP, _MODE) \
__extension__ \
({__voidptr *__ap = (__voidptr*)&_AP; \
((void *)__ap[__onstack])+=__size; \
if (__onstack==0 || (int)(__ap[2])==11) \
__ap[2]+= (__size >> 2); \
- *(( _MODE *)__param_addr); \
+ *(( _MODE *) (void *) __param_addr); \
})
void va_end (__gnuc_va_list); /* Defined in libgcc.a */
not word-aligned, we advance the pointer to the first non-reg slot. */
/* We don't declare the union member `d' to have type TYPE
because that would lose in C++ if TYPE has a constructor. */
+/* We cast to void * and then to TYPE * because this avoids
+ a warning about increasing the alignment requirement. */
#define va_arg(pvar,TYPE) \
__extension__ \
({ TYPE __va_temp; \
__u.__i[0] = ((int *) (pvar))[0]; \
__u.__i[1] = ((int *) (pvar))[1]; \
(pvar) += 8; \
- *(TYPE *)__u.__d; }) \
+ *(TYPE *) (void *) __u.__d; }) \
: ((pvar) += __va_rounded_size (TYPE), \
- *((TYPE *) ((pvar) - __va_rounded_size (TYPE)))));})
+ *((TYPE *) (void *) ((pvar) - __va_rounded_size (TYPE)))));})
#endif /* defined (_STDARG_H) || defined (_VARARGS_H) */