cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: wishlist: curl_easy_setopt(3): add better bad input warning?

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 6 Mar 2008 09:05:19 +0100 (CET)

On Thu, 6 Mar 2008, Jamie Lokier wrote:

>>> #define curl_easy_setopt(handle, option, value) \
>>> curl_easy_setopt(handle, option, value)
>>
>> Ah true. But I have this gut feeling that if we'd enable this for everyone
>> unconditonally, one of the more obscure and outdated compilers will scream
>> at us at some point.

> It should be accepted by any compiler claiming ANSI C. Macros which contain
> their own name aren't common, but they're not extremely rare either.

Yes, but I've learnt to be conservative about adding things like this since
they tend to bounce back at us at some point. Of course there's always room
for debating and discussing if it is warranted in this case. The other
approach is to simply do it and depend on users to report in case it goes boom
somewhere... We've done both ways in the past, I can't really tell which way
that is the best in the long run.

> How about enabling it #if __STDC__ >= 1?

Yes, that would be a small attempt to side-step the weirdest cases.

-- 
  Commercial curl and libcurl Technical Support: http://haxx.se/curl.html
Received on 2008-03-06