[ITK] ITKModuleMacros.cmake macro(itk_module_warnings_disable) MSVC warning D9025: overriding '/W1' with '/w'

Niels Dekker niels-xtk at xs4all.nl
Wed Feb 18 17:33:20 EST 2015


Thank you, Mike.  Apparently, those warnings only appear locally, not 
at the dashboard.

Note: The change within the itk_module_warnings_disable macro that I 
suggested yesterday isn't entirely correct, yet! I think that "/W0" 
should be added to the compiler flags in a separate CMake statement, 
_after_ the string(REGEX REPLACE...) statement:

  set(CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} /W0")

But I have to do some more testing  :-)

Kind regards, Niels

On 18 Feb 2015 8:08 PM, Michael Jackson wrote:
> I have seen this when building ITK 4.7.0 with Visual Studio 2013 SP4.
>
> Mike Jackson
>
>> Niels Dekker
>> Tuesday, February 17, 2015 10:54 AM
>> Floris Berendsen and I encountered many (5O+) 'D9025' warnings when we
>> built ITK on Visual Studio. The warning message text says:
>>
>> cl : Command line warning D9025: overriding '/W1' with '/w'
>>
>> Do other Visual Studio users also get these warnings, when compiling
>> ITK?
>> We don't see them at the dashboard,
>> https://open.cdash.org/index.php?project=Insight
>>
>> It appears that the warnings are triggered by the macro
>> 'itk_module_warnings_disable', ironically. This macro from
>> "ITKModuleMacros.cmake" adds "-w" to the compiler flags. Visual Studio
>> automatically adds "/W1" as well, which causes the compiler warning. It
>> appears that the warning can be avoided by a very small modification in
>> itk_module_warnings_disable: use "/W0" instead of "-w", in
>> ITKModuleMacros.cmake:
>>
>> foreach(lang ${ARGN})
>> if(MSVC)
>> string(REGEX REPLACE "(^| )[/-]W[0-4]( |$)" " "
>> - CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} -w")
>> + CMAKE_${lang}_FLAGS "${CMAKE_${lang}_FLAGS} /W0")
>>
>> "/W0" has the same meaning as "/w", see
>> https://msdn.microsoft.com/en-us/library/thxezb7y.aspx But it appears
>> that when itk_module_warnings_disable adds "/W0", instead of "-w", we
>> don't get those 'D9025' warnings.
>>
>> We saw this issue on both Visual Studio 2010 and Visual Studio 2013
>> (Update 4), and various versions of CMake, including the latest release,
>> CMake 3.1.3. We tried the ITK version from ITK.git.
>>
>> Kind regards, Niels



More information about the Community mailing list