[Insight-developers] warnings in vnl_math

Arnaud GELAS arnaud_gelas at hms.harvard.edu
Thu Mar 11 15:20:00 EST 2010


|Thanks Sean,

I used gcc 4.4 where the warning

"-Wconversion| now warns if the result of a |static_cast| to enumeral 
type is unspecified because the value is outside the range of the 
enumeral type. "

So should we care about that one?

On 03/11/2010 03:13 PM, Sean McBride wrote:
> On Thu, 11 Mar 2010 15:06:30 -0500, Arnaud GELAS said:
>
>    
>> By adding -Wconversion lots of warnings appear from vnl, vxl, gdcm, and
>> itk classes...
>>
>> I can set up a nightly build with -Wconversion, and start tracking some
>> of these issues (at least the one in itk), but what about the one coming
>>      
> >from external libraries?
>
> -Wconversion has very different meaning depending on the version of
> gcc.  In versions previous to 4.3 the warning is, IMNSHO, useless; I
> would not worry about warnings it generates.  As of 4.3 however, the
> warning is useful again, see;
>
> <http://gcc.gnu.org/gcc-4.3/changes.html>
>
> "The -Wconversion option has been modified. Its purpose now is to warn
> for implicit conversions that may alter a value. This new behavior is
> available for both C and C++. Warnings about conversions between signed
> and unsigned integers can be disabled by using -Wno-sign-conversion. In C
> ++, they are disabled by default unless -Wsign-conversion is explicitly
> requested. The old behavior of -Wconversion, that is, warn for
> prototypes causing a type conversion that is different from what would
> happen to the same argument in the absence of a prototype, has been
> moved to a new option -Wtraditional-conversion, which is only available
> for C."
>
>    
|


|
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20100311/2204b2f0/attachment.htm>


More information about the Insight-developers mailing list