Re: curl_easy_setopt and typeof
Date: Sun, 13 Apr 2008 11:08:36 -0400
On Apr 13, 2008, at 10:32 AM, Michal Marek wrote:
> David Shaw napsal(a):
>> I think the recent changes to curl_easy_setopt may have had some
>> fallout. GPG does stuff like this:
>> unsigned int myflag:1;
>> unsigned int myotherflag:1;
>> unsigned int verify_peer:1;
>> } flags;
>> curl_easy_setopt( curl, CURLOPT_SSL_VERIFYPEER, flags.verify_peer );
>> That worked in the past, but now fails with "error: 'typeof'
>> applied to
>> a bit-field".
>> It's arguable what the right thing to do here is. Certainly I can
>> cast that bitfield item to an int, but there may be other code out
>> that does similar things. Plus, there is a reasonable expectation
>> a bitfield item can be used as an int (it is, after all, an unsigned
>> int, albeit a very small one).
> Yes, but the docs say that you should pass a long here, not int. For
> time being, the macro allows int, too, because insisting on long would
> cause too much warnings almost everywhere. But I think in such a
> case it's really the application that should be fixed.
The issue is the bit-field, not whether the bits are int or long.
This fails in the same way:
curl_easy_setopt( curl, CURLOPT_SSL_VERIFYPEER, flags.verify_peer );
In that case, I am indeed passing a long.
> BTW, can you point me to the code doing this? gnupg-2.0.9 builds fine
Received on 2008-04-13