Re: some ports are broken after upgrading GCC 3.3.1

From: Motoyuki Konno <motoyuki_at_bsdclub.org>
Date: Fri, 18 Jul 2003 00:11:39 +0900
Add Cc: to -current list.


This seems to be "varargs.h" problem.  It seems that all C source
which use varargs.h and va_dcl become error on GCC 3.3.1 system.


Please try compiling following varargs.h sample program.

--------
#include <varargs.h>
void test(va_alist)
va_dcl
{
    va_list args;
    char *fmt;

    va_start(args);
    fmt = va_arg(args,char *);
    va_end(args);
}
--------

The result is as follows:

--------
motoyuki_at_sakura[38] % cc -c varargs_test.c
varargs_test.c: In function `test':
varargs_test.c:3: error: syntax error before '...' token
varargs_test.c:8: error: syntax error before "__builtin_varargs_start"
--------

I think following patch to /usr/include/varargs.h is needed
to solve this problem.

----
--- varargs.h.orig	Thu May 15 09:57:11 2003
+++ varargs.h	Fri Jul 18 00:10:23 2003
_at__at_ -55,7 +55,11 _at__at_
 typedef int __builtin_va_alist_t __attribute__((__mode__(__word__)));
 
 #define	va_alist		__builtin_va_alist
+#if __GNUC__ == 3 && __GNUC_MINOR__ >= 3
+#define	va_dcl			__builtin_va_alist_t __builtin_va_alist;
+#else
 #define	va_dcl			__builtin_va_alist_t __builtin_va_alist; ...
+#endif
 #define	va_start(ap)		__builtin_varargs_start(ap)
 #define	va_arg(ap, type)	__builtin_va_arg((ap), type)
 #define	va_end(ap)		__builtin_va_end(ap)
----

--
------------------------------------------------------------------------
Motoyuki Konno                  motoyuki_at_bsdclub.org             (Home)
                                motoyuki_at_FreeBSD.ORG  (FreeBSD Project)
                                http://www.freebsd.org/~motoyuki/ (WWW)

Shin-ichi YOSHIMOTO <yosimoto_at_waishi.jp> wrote:
> Subject: some ports are broken after upgrading GCC 3.3.1,
> On Sun, 13 Jul 2003 01:09:57 +0900, Shin-ichi YOSHIMOTO wrote:
> > ** The following packages were not installed or upgraded (*:skipped / !:fai
led)
> >         ! graphics/libungif (libungif-4.1.0b1)  (bad C++ code)
> >         ! x11-servers/XFree86-4-Server (XFree86-Server-4.3.0_8) (unknown bu
ild error)
> >         ! x11/XFree86-4-clients (XFree86-clients-4.3.0_2)       (coredump)
> 
> XFree86-4-Server and XFree86-4-clients are fine, but libungif is still bad,
> 
> [snip]
> /bin/sh ../libtool --mode=compile cc -DHAVE_CONFIG_H -I. -I. -I..     -O -pip
e -march=pentium4 -I/usr/X11R6/include -c qprintf.c
> rm -f .libs/qprintf.lo
> cc -DHAVE_CONFIG_H -I. -I. -I.. -O -pipe -march=pentium4 -I/usr/X11R6/include
 -c qprintf.c  -fPIC -DPIC -o .libs/qprintf.lo
> qprintf.c: In function `GifQprintf':
> qprintf.c:38: error: syntax error before '...' token
> qprintf.c:43: error: syntax error before "__builtin_varargs_start"
> *** Error code 1
> 
> Any idea ?
Received on Thu Jul 17 2003 - 06:11:42 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:15 UTC