cURL / Mailing Lists / curl-library / Single Mail

curl-library

CURLAUTH_ONLY definition and usage

From: Yang Tse <yangsita_at_gmail.com>
Date: Tue, 17 Apr 2012 14:56:13 +0200

CURLAUTH_ONLY was introduced Nov 11 2010 with commit 86367422 defined
as (1<<31) in curl.h

When building curl with Sun compiler it generates following compiler warning...

"src/tool_setopt.c", line 63: warning: integer overflow detected: op "<<"

Compiler warning is relevant. Current CURLAUTH_ONLY definition is not
a valid 32bit signed integer.

Additionally CURLAUTH_ONLY is not used at all in libcurl's code base.
So unless libcurl's code is checking somewhere that an 'auth' variable
is negative, I believe that CURLAUTH_ONLY it is not even working.

Another fact is that libcurl 'auth' variables holding CURLAUTH_*
bitmasks have a 'long' data type. This may alleviate the situation on
systems on which sizeof(long) > sizeof(int) in case CURLAUTH_ONLY were
to be used inside libcurl's code. But there are a bunch of platforms
on which 'int' and 'long' have the same size.

So...

Do we get rid of CURLAUTH_ONLY, do we type cast to 'unsigned int' all
CURLAUTH_* definitions in curl.h, do we modify CURLAUTH_ONLY
definition to (1<<30), or we do something different?

-- 
-=[Yang]=-
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2012-04-17