va_start still... [and again] with test case:

Ingo Krabbe i.krabbe@dokom.net
Wed Feb 11 07:50:00 GMT 2004


Hello,

since I currently experience an error while compiling my glibc for an older
system (--enable-kernel=2.0.0) I searched for this error in the internet and
found some hits on gcc.gnu.org, that still seems unresolved.

SEARCH RESULT:
>Re: va_start still...
>
>    * From: Zack Weinberg <zack at codesourcery dot com>
>    * To: Pablo Bleyer Kocik <pbleyer at embedded dot cl>
>    * Cc: gcc at gcc dot gnu dot org
>    * Date: Fri, 23 Aug 2002 20:45:47 -0700
>    * Subject: Re: va_start still...
>    * References: <5.1.1.6.0.20020823233652.01efb690@mail.embedded.cl>
>
>On Fri, Aug 23, 2002 at 11:43:05PM -0400, Pablo Bleyer Kocik wrote:
>> 
>>  Hello.
>> 
>>  I thought this was being fixed in 3.2, but I am still getting "'va_start' 
>> used in function with fixed args" under gcc 3.2 with optimization levels 
>> above 2 when compiling functions with ellipses. Is this right?
>>
>Post a test case, please.
>
>zw
====================

So I decieded to write a test case and detected that error might be reproduced
very easy:

gcc -c test.c
with test.c=
========================== snip
#include <stdarg.h>
#include <stdio.h>


int
test_func(s,format)
	const char* s;
	const char* format;
{
	va_list arg;
	int done;

	va_start( arg, format );
	done = vsscanf( s, format, arg );
	va_end( arg );

	return done;
}
========================== snip

As far as I know the function int test_func with old-style definition syntax is
well defined and might be used as variadic arg function ! Or am I wrong ???

Anyway there seems to be some old style code existent that uses this syntax
(for example the i386 stdio-common/sscanf.c from glibc-3.2.3).

So what's the issue here ?

BYE INGO



More information about the Gcc mailing list