cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: curl_easy_setopt() typechecker, try3

From: Jamie Lokier <jamie_at_shareable.org>
Date: Tue, 11 Mar 2008 02:04:39 +0000

Dan Fandrich wrote:
> >> this is basically a repost, as I didn't get further comments on the prefix
> >> issue pointed out by Dan F. The issue is the usage of underscored macros
> >> and identifiers (e.g _curl_is_long()):
>
> I didn't realize anyone was waiting for more input--the last message
> addressed things well enough for me.
>
> > I'm happy with it as it works right now! I agree that the underscores
> > shouldn't cause any problems since this is quite limited compiler-wise and
> > are easy to fix later on if we ever run into any problems with them.
>
> True, it's unlikely to cause any problems but it is illegal so we might as
> well get it right the first time around.

Then you will have to change the header guard macros too :-)

I thought about the same problem with my portable library, and I ended
up deciding that underscore-prefix names are acceptable despite being
illegal in applications. (If it helps, you can say libcurl is a system
library and therefore it's legal to use underscore prefix names.)

The reason being that avoiding name conflicts with other libraries is
the important thing, and avoiding underscore prefix no more guarantees
that than not avoiding underscore prefix. I'm guessing that it
doesn't even make it more likely these days, provided your names
aren't too generic.

I'd be very happy to be proven wrong, though.

-- Jamie
Received on 2008-03-11