Subject: pkg/22671: mpg123 does not compile with gcc 3.3.1
To: None <gnats-bugs@gnats.netbsd.org>
From: Martin Husemann <martin@aprisoft.de>
List: netbsd-bugs
Date: 09/03/2003 12:18:59
>Number:         22671
>Category:       pkg
>Synopsis:       mpg123 does not compile with gcc 3.3.1
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Sep 03 10:20:01 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Martin Husemann
>Release:        NetBSD 1.6X
>Organization:
>Environment:
System: NetBSD nelly.aprisoft.de 1.6X NetBSD 1.6X (NELLY) #2: Thu Aug 28 15:33:52 CEST 2003 martin@nelly.aprisoft.de:/usr/src/sys/arch/sparc64/compile/NELLY sparc64
Architecture: sparc64
Machine: sparc64
>Description:

With (in-tree) gcc 3.3.1 on sparc64 the compilation of audio/mpg123
fails:

cc -O -ffixed-g4 -pipe -I/usr/pkg/include -Wall -ansi -pedantic -O3 -fomit-frame-pointer  -funroll-all-loops -ffast-math -DREAD_MMAP  -DREAL_IS_FLOAT -DUSE_MMAP -DTERM_CONTROL -DNETBSD  -DINET6  -I/usr/pkg/include -c control_generic.c
control_generic.c: In function `generic_sendstat':
control_generic.c:33: error: `va_start' used in function with fixed args
control_generic.c: In function `control_generic':
control_generic.c:33: error: `va_start' used in function with fixed args

The code looks just fine to me:

...
#include <stdarg.h>
...
void generic_sendmsg (char *fmt, ...)
{
        va_list ap;
        printf("@");
        va_start(ap, fmt);
        vprintf(fmt, ap);
        va_end(ap);
        printf("\n");
}

So I don't understand what gcc is trying to tell us here.
The problem goes away when the optimization level is reduced from -O3 to -O2.

>How-To-Repeat:
s/a
>Fix:
n/a
>Release-Note:
>Audit-Trail:
>Unformatted: