Subject: Re: libssh2 master 3420e98... use const to silence a bazillion warnings

Re: libssh2 master 3420e98... use const to silence a bazillion warnings

From: Alexander Lamaison <swish_at_lammy.co.uk>
Date: Tue, 2 Mar 2010 14:43:30 +0000

On 1 March 2010 10:08, Daniel Stenberg <daniel_at_haxx.se> wrote:
> On Mon, 1 Mar 2010, libssh2_at_git.stuge.se wrote:
>
>>   use const to silence a bazillion warnings

I left the errmsg parameter non-const as the string may be freed when
the should_free parameter is true. Now that it's const, I get
warnings in all the places that try to free it. Basically, whichever
way we do this we're screwed as this function can't take both a const
and a non-const parameter. Even providing two versions, one that
frees and one that doesn't wont help as unless the session itself has
one pointer for the const string and one for the freeable non-const
string.

Do we ever actually call libssh2_error with a string we want freed?
I've not come across any but its tricky to search for.

> My advice to committers: use configure --enable-debug to get a wide range of
> picky compiler options enabled.

I'm developing on Windows but I'll try to build on Linux before
pushing in future.

Alex
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2010-03-02