This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: va_list,va_start,va_end


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]