[Insight-developers] VS warning suppression in itk
Bill Lorensen
bill.lorensen at gmail.com
Tue Jul 30 17:21:06 EDT 2013
I would say a bug.
On Tue, Jul 30, 2013 at 5:15 PM, Rupert Brooks <rupert.brooks at gmail.com>wrote:
> Hi everyone,
>
> This has apparently been happening for a long time, but i only noticed it
> recently. ITK suppresses a number of Visual Studio warnings in its header
> files, without pushing or popping the warning state. As a result,
> including an ITK header quietly suppresses a number of warnings in my own
> code.
>
> This is rather undesirable, as our coding standard decisions were to have
> those warnings on, intentionally, and this slipped by completely unnoticed
> for quite some time.
>
> Among the warnings suppressed are
> warning C4018: '<' : signed/unsigned mismatch
> warning C4305: 'initializing' : truncation from 'double' to 'float'
> warning C4244: '=' : conversion from 'float' to 'int', possible loss of
> data
>
> Most, but not all, of the suppression takes place in itkWin32Header.h.
> However C4018 is suppressed in vcl_compiler.h. There are probably other
> subtleties. I discovered it on 3.20, and its also true in the current
> release.
>
> I'm curious if this is a design choice, an oversight, or a downright bug.
> Global warning suppression seems counter to the "ITK way".
>
> A possible workaround is to remember to do a #pragma warning(push) and
> (pop) around itk headers. If anyone has a better workaround, please let me
> know.
>
> Best,
> Rupert
>
>
>
> --------------------------------------------------------------
> Rupert Brooks
> rupert.brooks at gmail.com
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-developers
>
>
--
Unpaid intern in BillsBasement at noware dot com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/pipermail/insight-developers/attachments/20130730/37765395/attachment.htm>
More information about the Insight-developers
mailing list