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]

[Bug c/29739] -Wconversion produces invalid warnings.



------- Comment #2 from lopezibanez at gmail dot com  2006-11-06 16:30 -------
(a bit more explanation won't hurt)

The GCC documentation says: 

-Wconversion: Warn if a prototype causes a type conversion that is different
from what would happen to the same argument in the absence of a prototype.

In your program, in the absence of prototype, d would be promoted to int, thus
the warning is correct. Wconversion is only useful for translating very old C
code to ANSI/ISO C.

Since this behaviour is not very useful in the present day, and Wconversion
also warns for unsigned i = -1, we are going to move the above behaviour to
Wtraditional-conversion and make Wconversion warn for implicit conversions that
may change a value. This is planned for GCC 4.3 .

For more info, please check http://gcc.gnu.org/wiki/Wcoercion and don't
hesitate to contact me. (That wiki page is work in progress, not definitive,
actually, it is a bit outdated). Testing and comments are welcome.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29739


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