<div dir="ltr">I would say a bug.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jul 30, 2013 at 5:15 PM, Rupert Brooks <span dir="ltr"><<a href="mailto:rupert.brooks@gmail.com" target="_blank">rupert.brooks@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi everyone,<div><br></div><div>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.</div>
<div><br></div><div>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.</div><div><br></div><div>Among the warnings suppressed are</div>
<div><div>warning C4018: '<' : signed/unsigned mismatch</div><div>warning C4305: 'initializing' : truncation from 'double' to 'float'</div><div>warning C4244: '=' : conversion from 'float' to 'int', possible loss of data</div>
</div><div><br></div><div>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.</div>
<div><br></div><div>I'm curious if this is a design choice, an oversight, or a downright bug. Global warning suppression seems counter to the "ITK way".</div><div><br></div><div>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.</div>
<div><br></div><div>Best,</div><div>Rupert</div><div><br></div><div><br></div><div><br></div><div><div>--------------------------------------------------------------<br>Rupert Brooks<br><a href="mailto:rupert.brooks@gmail.com" target="_blank">rupert.brooks@gmail.com</a><br>
</div>
</div></div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://kitware.com/products/protraining.php" target="_blank">http://kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-developers" target="_blank">http://www.itk.org/mailman/listinfo/insight-developers</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>Unpaid intern in BillsBasement at noware dot com<br>
</div>