This is the mail archive of the gcc-help@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: gcc does not work with va_arg on irix 6.5


Hi,

I've got the solution: Include gcc version of stdarg.h (under
/MY/GCC/INSTALL/lib/gcc-lib/mips-sgi-irix6.5/2.8.1/include/) instead of
the native stdarg.h (under /usr/include).

Thanks for all the responses.

Betty



In article <83rdov$6ir$1@nnrp1.deja.com>,
  Betty <bli@zeh.com> wrote:
> Hello,everyone,
>
> I have the following C code:
>
> /*file va-arg.c*/
> #include <stdarg.h>
>
> void f1(int n, ...)
> {
>     va_list ap;
>     int  i;
>     char a;
>
>     va_start(ap,n );
>
>     a=va_arg(ap,char);
>     i=va_arg(ap,int);
>
>     va_end(ap);
> }
>
> int main()
> {
>    char a='a';
>    int i=1;
>
>    f1(2, a,i);
>
>    return 0;
> }
>
> When I compile it on irix 6.5 using gcc 2.8.1 or gcc 2.95.2, it gives
> me the followings errors:
>
> va-arg.c: In function `f1':
> va-arg.c:11: parse error before `char'
> va-arg.c:11: parse error before `char'
> va-arg.c:11: parse error before `char'
> va-arg.c:11: parse error before `char'
> va-arg.c:11: parse error before `char'
> va-arg.c:11: parse error before `)'
> va-arg.c:12: parse error before `int'
> va-arg.c:12: parse error before `int'
> va-arg.c:12: parse error before `int'
> va-arg.c:12: parse error before `int'
> va-arg.c:12: parse error before `int'
> va-arg.c:12: parse error before `)'
>
> Any idea how to make va_arg work on irix 6.5 with gcc?
>
> Thank you for your help.
>
> Betty
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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