2008/9/19 Richard Guenther <[EMAIL PROTECTED]>:
>
> The computation __x) >> 8) & 0xff) | (((__x) & 0xff) << 8)) is promoted
> to int as of C language standards rules and the store to __v truncates it.
>
> The warning isn't clever enough to see that this doesn't happen due to
> the masking appl
On Fri, Sep 19, 2008 at 5:03 PM, Andriy Gapon <[EMAIL PROTECTED]> wrote:
>
> There is a very simple function:
> / func.c **/
> #include
>
> uint16_t my_htons(uint16_t hostshort)
> {
>return htons(hostshort);
> }
> /**/
>
> $ cc func.c -Wconversion -W
There is a very simple function:
/ func.c **/
#include
uint16_t my_htons(uint16_t hostshort)
{
return htons(hostshort);
}
/**/
$ cc func.c -Wconversion -Werror -c -o func.o
Exit 0
$ cc func.c -O1 -Wconversion -Werror -c -o func.o
cc1: warnings b