COMP: Place #define _SILENCE_..._DEPRECATION_WARNING before #include#3970
Conversation
You're welcome @blowekamp Just wondering, did your original PR #3897 commit 3a9c762 already suppress the warnings for you? Because at my side, I kept seeing those warnings. |
|
For the record, here a minimal example (https://godbolt.org/z/Ks51f1bjo): Using command-line options
Place the |
|
I just realized that the warning is not specific to C++17, it also appears when compiling with |
| *=========================================================================*/ | ||
|
|
||
| #if !defined(ITK_LEGACY_REMOVE) | ||
| // Supress MSVC warnings |
There was a problem hiding this comment.
Shall I still do an amend/force-push to adjust the comment a little bit? It has a minor typo ("Supress"). No problem, of course.
There was a problem hiding this comment.
Yes, please fix the misspelling.
Moved each `_SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING` macro definition upward, placing it before the very first `#include` statement. Fixes Visual C++ 2022 warnings like: > warning C4996: 'std::complex<char>::complex': warning STL4037: The effect of instantiating the template std::complex for any type other than float, double, or long double is unspecified. You can define _SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNING to suppress this warning. Follow-up to pull request InsightSoftwareConsortium#3897 commit 3a9c762 "COMP: Supress warning in MSVC for non-float complex"
14782c4 to
51e4618
Compare
Moved each
_SILENCE_NONFLOATING_COMPLEX_DEPRECATION_WARNINGmacro definition upward, placing it before the very first#includestatement.Fixes Visual C++ 2022 warnings like:
Follow-up to pull request #3897 commit 3a9c762
"COMP: Supress warning in MSVC for non-float complex"
(Cherry-picked from pull request #3969.)