This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcc's -Wconversion


Geoff Thorpe <geoff@geoffthorpe.net> writes:

|> 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

-Wconversion is designed to help moving K&R to ISO C, nothing more.

|> 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".

This is exactly behaving as documented.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]