/pidgin/main: a9d3726c3a8f: Clang warnings: clean up libpurple

Mark Doliner mark at kingant.net
Mon Oct 7 00:05:30 EDT 2013


On Sun, Oct 6, 2013 at 1:14 AM, Tomasz Wasilczyk <twasilczyk at pidgin.im> wrote:
> 2013/10/6 Mark Doliner <mark at kingant.net>:
>> Hey Tomasz, I have some questions about this commit. I can't quote all
>> the changes because the diff was truncated, but basically:
>> 1. For the places where you cast an 8 bit variable to an int before
>> printing it, could you remove the cast and print it using "%hhx"? Or
>> is Clang not ok with that for some reason? Casting tends to hide
>> problems and I think the code is cleaner without it.
>
> %hhx doesn't seems to be supported on win32. See my previous commit [1].

Ah, that's too bad. It looks like hh might even be a C99-ism.

>> 2. What's the reason for casting aimutil_put32() to void? What was
>> Clang complaining about?
>
> Clang throws a warning on unused expression (not function) result. And
> aimutil_put32 is a macro expanding to (something(),something(),4).
>
> Casting to void just silences it. I don't think it's a problem,
> because its output is definitely constant.

Ah, I see. Thanks for the explanation.



More information about the Devel mailing list