This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: gcc does not work with va_arg on irix 6.5
- To: help-gcc at gnu dot org
- Subject: Re: gcc does not work with va_arg on irix 6.5
- From: Patrick Therien <ptherie at uswest dot com>
- Date: Wed, 22 Dec 1999 15:10:30 -0600
- Newsgroups: gnu.gcc.help
- Organization: U S WEST Information Technologies, Inc.
- References: <83rdov$6ir$1@nnrp1.deja.com>
- Xref: wodc7nx0 gnu.gcc.help:2270
Try adding #include <sys/varargs.h>
Betty 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.
begin:vcard
n:Therien;Patrick
tel;pager:402-977-0824
tel;fax:402-422-7718
tel;home:402-734-3184
tel;work:402-422-5090
x-mozilla-html:FALSE
url:http://sdsc.uswc.uswest.com/~ptherie/
org:US West;Ordering Billing Applications Operations
version:2.1
email;internet:ptherie@uswest.com
title:IT Specialist
adr;quoted-printable:;;1314 Douglas on the Mall=0D=0A14th Floor;Omaha;NE;68102;USA
x-mozilla-cpt:;-1
fn:Patrick Therien
end:vcard