libpcp / pcp

PCP client library
BSD 2-Clause "Simplified" License
69 stars 30 forks source link

learned_dscp is a uint8_t and not a unsigned short, pass u to printf ins... #2

Closed shadeslayer closed 10 years ago

shadeslayer commented 10 years ago

Hi libpcp doesn't compile with clang without this fix. I get:

pcp_app.c:362:18: error: format specifies type 'unsigned short' but the argument has type 'uint8_t' (aka 'unsigned char') [-Werror,-Wformat]
                 ret->learned_dscp,
             ^~~~~~~~~~~~~~~~~
1 error generated.

I have successfully compiled with both clang and gcc after modifying the code. All tests pass as well.

shadeslayer commented 10 years ago

%hhu also works, I'm not too familiar with these types, so please fee free to point out any mistakes.