Bug#128950: gcc's -Wconversion
Hi all,
I've just been searching the gcc bug database because of what I observed
to be a damned annoying behaviour of -Wconversion, and lo' and behold,
it looks like you've all been there and done that (PR#: 9072 and 6614).
Right now, use of -Wconversion seems to be pretty much useless to me if
I use any function that accepts a parameter smaller than 32-bits. Eg.
void foo(unsigned short b)
{
foo(b + 1);
}
compiled with "gcc -Wconversion" gives the dreaded "warning: passing arg
1 of `foo' with different width due to prototype".
Use of libc functions such as htons also pose a problem so I'm
essentially forced to avoid -Wconversion, which I think is a shame - it
should be a useful check to have in place, but appears to deal with ABI
checking rather than C type checking[1].
If the efforts being made in #9072 were held up, as was suggested in one
of the mails, by lack of interest - let me chime in here and say that I
for one would love to see this sorted out and bravo to whoever does it!
:-)
Regards,
Geoff
[1] Please excuse such looseness of terminology, I'm anything but a
compiler-guru ...
--
Geoff Thorpe
geoff@openssl.org
http://www.openssl.org/
Reply to: