This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: va_list,va_start,va_end
- To: "Alex Feldman" <al dot feldman at sangoma dot com>,<gcc-bugs at gcc dot gnu dot org>
- Subject: Re: va_list,va_start,va_end
- From: Franz Sirl <Franz dot Sirl-kernel at lauterbach dot com>
- Date: Wed, 5 Sep 2001 23:21:56 +0200
- References: <MDELJBBOHGLAJHGDPONDMEJCCCAA.al.feldman@sangoma.com>
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.