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++/26167] -Wconversion fails to detect signedness conversion from int to unsigned int in fuction call



------- Comment #6 from lopezibanez at gmail dot com  2006-09-16 01:08 -------
In which way gcc reports the problem correctly? What gcc currently reports is
that if the prototype were missing the value would be passed as a signed int.
It is not warning you about the conversion, it warns you about the effect of
having a prototype.

If you mean that gcc (and g++) should warn that a signed variable is passed to
a function that expects an unsigned variable, then when using the -Wcoercion
flag (provided by the Wcoercion project [*]), both cc1 and cc1plus report:

pr26167.cpp:10: warning: coercion to 'unsigned int' from 'int' may alter its
value

[*] http://gcc.gnu.org/wiki/Wcoercion


-- 

lopezibanez at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lopezibanez at gmail dot com


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


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