Hi all,

for gcc use -Wconversion :

-Wconversion
Warn for implicit conversions that may alter a value. This includes
conversions between real and integer, like abs (x) when x is double;
conversions between signed and unsigned, likeunsigned ui = -1; and
conversions to smaller types, like sqrtf (M_PI). Do not warn for explicit
casts like abs ((int) x) and ui = (unsigned) -1, or if the value is not
changed by the conversion like in abs (2.0). Warnings about conversions
between signed and unsigned integers can be disabled by using
-Wno-sign-conversion.

For C++, also warn for confusing overload resolution for user-defined
conversions; and conversions that never use a type conversion operator:
conversions to void, the same type, a base class or a reference to them.
Warnings about conversions between signed and unsigned integers are
disabled by default in C++ unless -Wsign-conversion is explicitly enabled.




--
Mathieu


On 31 May 2013 13:41, michael kapelko <[email protected]> wrote:

> To the topic of GCC warnings. I frequently had a chance to get more
> warnings during MinGW compilation than Linux one.
>
>
> 2013/5/31 Ulrich Hertlein <[email protected]>
>
>> On 31/05/13 12:15, Robert Osfield wrote:
>> > I am wondering if there is an option in g++ that I might be able to
>> > enable to spot this particular warning, this way I'll be able to spot
>> > them soon after creating the problem.
>>
>> I wasn't able to generate the same warning using g++ with the '-Wall' and
>> '-Wextra'
>> switches :-(
>>
>> /ulrich
>> _______________________________________________
>> osg-submissions mailing list
>> [email protected]
>>
>> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>>
>
>
> _______________________________________________
> osg-submissions mailing list
> [email protected]
>
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
>
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to