Subject: Re: Warnings during building

Re: Warnings during building

From: Simon Josefsson <simon_at_josefsson.org>
Date: Mon, 14 Dec 2009 14:04:31 +0100

Daniel Stenberg <daniel_at_haxx.se> writes:

> On Mon, 14 Dec 2009, Simon Josefsson wrote:
>
>> (void) enc;
>>
>> And of course there are GCC attributes too. How do people feel
>> about adding the above way to resolve unused parameter warnings? I
>> don't really like it (it is a hack), and it isn't guaranteed to work
>> in general, but it does appear to solve the problem right now.
>
> While perhaps not guaranteed, we use that approach in libcurl and I'm
> not aware of any existing compiler that doesn't support it...

I take that as a +0.5 then.

> To do it _really_ portable, I figure we should use a macro as
> UNUSED(enc) and then we let preprocessor magic decide the best way for
> the particular compiler used.

Assuming that is even possible -- I could imagine some compilers will
want the change in the prototype, some in the function body, some in the
function definition, and so on...

/Simon
_______________________________________________
libssh2-devel http://cool.haxx.se/cgi-bin/mailman/listinfo/libssh2-devel
Received on 2009-12-14