bug in clang printf format | was Re: Strange warning with clang and 9RC1 (ntohs)

2011-11-04 Thread Axel Gonzalez
After getting in contact with clang's ml, the determined that this a bug in clang's format checker. Note that this bug affects: printf(%hu\n, ntohs(x)); This happens in 9 that ntohs is defined as a macro using conditinal operator (? :) The discussion is here:

Re: Strange warning with clang and 9RC1 (ntohs)

2011-11-01 Thread Roman Divacky
It doesnt warn here. Can you check with clang -E what the ntohs() is being expanded to and what the real prototype is? On Mon, Oct 31, 2011 at 06:35:18PM -0600, Axel Gonzalez wrote: I'm getting an strange warning whem compiling with clang (from base) on RC1. This warning doesn't appear with

Re: Strange warning with clang and 9RC1 (ntohs)

2011-11-01 Thread Axel Gonzalez
Here is the output (short version): ... (snip) static __inline __uint16_t __bswap16_var(__uint16_t _x) { return ((__uint16_t)((_x) 8 | (_x) 8)); } ... (snip) int main() { uint16_t x = (__builtin_constant_p(80) ? (__uint16_t)(((__uint16_t)(80)) 8 | ((__uint16_t)(80)) 8) :

Strange warning with clang and 9RC1 (ntohs)

2011-10-31 Thread Axel Gonzalez
I'm getting an strange warning whem compiling with clang (from base) on RC1. This warning doesn't appear with 8.X and clang from ports. The warning is strange because ntohs is not int: uint16_t ntohs(uint16_t netshort); Any insight would be appreciated, thanks in advance! A %