cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: curl_easy_setopt and typeof

From: Michal Marek <mmarek_at_suse.cz>
Date: Mon, 14 Apr 2008 09:30:02 +0200

Michal Marek wrote:
> David Shaw napsal(a):
>> struct
>> {
>> 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".
>>
> Yes, but the docs say that you should pass a long here, not int. For the
> time being, the macro allows int, too, because insisting on long would
> cause too much warnings almost everywhere. But I think in such a corner
> case it's really the application that should be fixed.

I mean, it's a pity that passing a bitfield to the curl_easy_setopt
macro generates code that gcc doesn't accept, but I don't see a way to
work around this. And passing a bitfileld here was a bad idea in first
place.

> BTW, can you point me to the code doing this? gnupg-2.0.9 builds fine
> here...

Never mind, I was looking at a build without curl support ;-)

Michal
Received on 2008-04-14