This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
gcc's -Wconversion
- From: Geoff Thorpe <geoff at geoffthorpe dot net>
- To: Agthorr <agthorr at barsoom dot org>
- Cc: Segher Boessenkool <segher at koffie dot nl>, "Joseph S. Myers" <jsm28 at cam dot ac dot uk>,bangerth at dealii dot org, 128950 at bugs dot debian dot org, gcc-bugs at gcc dot gnu dot org,gcc-gnats at gcc dot gnu dot org, josh dot dybnis at sandtechnology dot com
- Date: Thu, 06 Feb 2003 17:22:43 -0500
- Subject: 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/