va_list,va_start,va_end

Franz Sirl Franz.Sirl-kernel@lauterbach.com
Wed Sep 5 14:21:00 GMT 2001


On Wednesday 05 September 2001 22:48, Alex Feldman wrote:
> Hello
>
> In addition to my question, I trying to compile this program:
>
> #include <stdio.h>
> #include <stdarg.h>
>
> void proc_add_line(char*frm, ...)
> {
> 	va_list va_arg;
>
> 	va_start(frm, va_arg);
> 	vprintf(frm, va_arg);
> 	va_end(va_arg);
> }
> int main()
> {
> proc_add_line("Test");
> }
>
> I received the follow errors:
> 	test.c: In function `proc_add_line':
> 	test.c:6: parse error before `__builtin_va_arg'
> 	test.c:8: parse error before `)'
> 	test.c:9: parse error before `)'
> 	test.c:10: parse error before `)'
>
> The same code compiled in previous version of GCC.
>
> what's wrong?

va_arg is a reserved word if you include stdarg.h, use a different name for 
your variable.

Franz.



More information about the Gcc-bugs mailing list