<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">rupert.brooks@gmail.com</a><br>
</div>
</div></div>