cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Working with curl connections as with sockets.

From: Michal Marek <mmarek_at_suse.cz>
Date: Mon, 05 May 2008 15:59:18 +0200

Daniel Stenberg wrote:
> On Wed, 30 Apr 2008, tetetest tetetest wrote:
>
>> Because Curl_write() accepts argument of type 'void*', and not 'const
>> void*', there is a warning when you compile with GCC:
>>
>> In future, it would be nice to change 'void*' to 'const void*' for
>> Curl_write() and other functions that are not supposed to modify the
>> buffers. So, the warning could serve as a reminder. :)
>
> I agree, we should change Curl_write() accordingly. Your patch could be
> committed with the const, and then we (I?) can go on to fix the existing code.

Here is a patch for that, it works almost fine except for krb[45], where
the APIs take a non-const pointer:

krb5.c:131: warning: assignment discards qualifiers from pointer target type

What needs to be done is to check whether the various krb libraries
don't modify the buffer and then add a cast.

Michal

Received on 2008-05-05