cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Libcurl Help required!

From: Vishal_garg <Vishal_garg_at_infy.com>
Date: Wed, 17 Apr 2002 09:45:16 +0530

Hi,
I have tried working on this problem and changing the names of variables major and minor solves the problem.
I don't have any explanation for this.

Regards,
Vishal.

-----Original Message-----
From: Bjorn Reese [mailto:breese_at_mail1.stofanet.dk]
Sent: Tuesday, April 16, 2002 9:58 PM
To: libcurl Mailing list
Cc: Puneet Garg
Subject: Re: Libcurl Help required!

Daniel Stenberg wrote:

> char major[128];
>
> Now how can this be wrong? Can you process-only this file and see what on
> earth it tries to do?

I bet the compiler assumes K&R syntax, and therefore expects the
declaration of the arguments, and instead finds the declaration of
local variables.

In K&R, functions must look like this:

  int MyFunction(firstArgument, secondArgument)
    int firstArgument;
    char *secondArgument;
  {
     /* The function body goes here */
  }

> > "../../lib/formdata.c", line 931: va_start: argument mismatch
>
> Hm, does this compiler require "old style" va_arg usage?

Definitely an K&R compiler (where va_start only has one argument).

> > Is it possible to build libcurl on solaris native compiler (cc)?????
>
> I used to think it was, but with this output I guess we can say that it
> doesn't. These problems should be possible to correct though, as I would
> really like curl to build properly just like that...

Before venturing down the road of K&R compatibility it may be worthwhile
to investigate whether the compiler supports ANSI C, or another ANSI C
compiler (e.g. gcc or Sun Workshop) is available. K&R was preceeded by
ANSI C back in 1989, and there aren't many K&R compilers left.

If libcurl should support K&R syntax, you should be aware that it is
a major, albeit largely trivial, task to make source code compile on
both K&R and ANSI C compilers (I did this recently on the trio project).
Useful information about the differences can be found at

    http://docs.sun.com/htmlcoll/coll.33.7/iso-8859-1/CUG/tguide.html
Received on 2002-04-17