This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Function with variable number of arguments.
- To: alexey at mdis dot ru
- Subject: Re: Function with variable number of arguments.
- From: "Martin v. Loewis" <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Date: Sat, 9 Oct 1999 01:21:20 +0200
- CC: bug-gcc-request at gnu dot org, gnu at gnu dot org, bug-gcc at gnu dot org, help-gcc at gnu dot org
- References: <000601bf0b45$b0709380$3f50a8c0@mdis.ru>
Alexey,
Thanks for your bug report. Please post original and complete source
the next time (http://egcs.cygnus.com/faq.html#bugreport)
> int test(char * format,...)
>
Here is an opening { missing.
>
> va_list marker
Here is a semicolon missing.
> va_start(marker,format);
> return va_arg(marker,int);
According to ISO C, you *must* use va_end.
> }
> int i ;
> rtems_task Init( rtems_task_argument ignored )
>
>
>
> i = test("ABC",0xAA55);
> exit(0);
> }
> I expect to see 0xAA55 in i but recieve 0.
After I corrected these errors, your example works correctly for me on
i486-pc-linux-gnu.
Perhaps the problem is caused by the cross-compiling environment? Are
you using the correct version of stdarg.h? i.e. the one of the target
environment?
If so, I can't help further: I don't know what target mips64orion is.
Hope this helps,
Martin