cURL / Mailing Lists / curl-library / Single Mail

curl-library

curl_easy_setopt and typeof

From: David Shaw <dshaw_at_jabberwocky.com>
Date: Sun, 13 Apr 2008 10:09:43 -0400

Hi,

I think the recent changes to curl_easy_setopt may have had some
fallout. GPG does stuff like this:

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".

It's arguable what the right thing to do here is. Certainly I can
just cast that bitfield item to an int, but there may be other code
out there that does similar things. Plus, there is a reasonable
expectation that a bitfield item can be used as an int (it is, after
all, an unsigned int, albeit a very small one).

David
Received on 2008-04-13