Re: gcc 4.3.0, -Wconversion against -O1

2008-09-19 Thread Manuel López-Ibáñez
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

Re: gcc 4.3.0, -Wconversion against -O1

2008-09-19 Thread Richard Guenther
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

gcc 4.3.0, -Wconversion against -O1

2008-09-19 Thread Andriy Gapon
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