Subject: Re: port-sparc/1852: changes for sparc for gcc 2.7.2
To: None <mrg@eterna.com.au>
From: Chris G Demetriou <Chris_G_Demetriou@BALVENIE.PDL.CS.CMU.EDU>
List: netbsd-bugs
Date: 12/21/1995 08:12:49
matt green tried to fix sparc varargs for new gcc by saying:
> ***************
> *** 62,70 ****
> *
> * va_end cleans up after va_start. There is nothing to do there.
> */
> ! #ifdef __GCC_NEW_VARARGS__ /* gcc 2.4.5 */
> #define va_start(ap, l) ((ap) = (va_list)__builtin_saveregs())
> ! #else /* gcc 2.3.3 */
> #define va_start(ap, l) (__builtin_saveregs(), \
> (ap) = (va_list)__builtin_next_arg())
> #endif
> --- 62,70 ----
> *
> * va_end cleans up after va_start. There is nothing to do there.
> */
> ! #if __GNUC__ >= 2 && __GNUC_MINOR__ >= 4 /* gcc 2.4.5 */
> #define va_start(ap, l) ((ap) = (va_list)__builtin_saveregs())
> ! #else /* gcc 2.3.3 */
> #define va_start(ap, l) (__builtin_saveregs(), \
> (ap) = (va_list)__builtin_next_arg())
> #endif
This test is incorrect, and will break for e.g. gcc 3.0 -> gcc 3.3.
what you really want is:
#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 4)
chris