[vtkusers] A fix for MSVC warning D9025: overriding '/W1' with '/w'

Niels Dekker - address until 2018 niels_dekker_address_until_2018 at xs4all.nl
Tue Sep 29 08:45:32 EDT 2015


You're welcome, Cory! I just saw your merge of my 
'MSVC-warning-D9025-fix' at 
https://gitlab.kitware.com/vtk/vtk/commit/c9901c775451ff2031750f1f5fc7c2ebdeb0a192

Kind regards, Niels

Cory Quammen wrote on September 28, 2015:
 > Hi Niels,
>
> I merged your change last night.
>
> Thank you for contributing to VTK!
>
> Best regards,
> Cory
>
> On Sat, Sep 26, 2015 at 4:19 PM, Niels Dekker wrote:
>
>     Hi again, Cory,
>
>     Please check my merge request, and please merge, if you think it's
>     fine: https://gitlab.kitware.com/vtk/vtk/merge_requests/704
>
>     Kind regards, Niels
>
>
>     On 23 Sep 2015 6:40 PM, I wrote:
>
>         Hi Cory,
>
>         Thanks for the information. Actually, explaining why exactly those
>         warnings appear might be the hardest part! It looks like the
>         following
>         is happening, for a subproject that was meant to have suppressed
>         warnings:
>             1. For such a subproject, VTK replaces any compiler option
>         regarding warning-levels from CMAKE_C_FLAGS and CMAKE_CXX_FLAGS by
>         '/w' and '-w'.
>             2. CMake then created a Visual Studio project file
>         ("*.vcxproj")
>         that does not have any <WarningLevel> XML tag. Instead, CMake adds
>         '/w' and '-w' to the <AdditionalOptions> XML tag.
>             3. Visual Studio finds out that the <WarningLevel> tag is
>         missing,
>         and so it adds warning-level 1 ('/W1') as its default
>         warning-level.
>         However, it also adds those '/w' and '-w' from
>         <AdditionalOptions> to
>         the command-line.
>             4. The C++ compiler (cl.exe) gets '/W1, as well as '/w'
>         and '-w',
>         so it complains about overriding '/W1' with '/w'.
>
>         Fortunately this problem does not occur when VTK uses '/W0',
>         instead
>         of '/w' or '-w'!
>
>         Kind regards, Niels
>
>         Cory Quammen wrote on September 23, 2015, 16:22:
>
>             Niels,
>
>             I saw that you contributed to ITK via gerrit. Contributing
>             to VTK is
>             similar, but it uses gitlab instead of gerrit. I wouldn't
>             bother with
>             a bug report for this issue - just explaining why the
>             warnings appear
>             in the commit message is sufficient.
>
>             Thanks for offering to contribute! I will watch for your
>             patch and
>             shepherd it through the review process.
>
>             Best,
>             Cory
>
>             On Wed, Sep 23, 2015 at 10:16 AM, Niels Dekker wrote:
>
>                  Hi Cory,
>
>                  Thank you! When I have time (hopefully before next
>             Sunday), I'll
>                  try to contribute the patch via your gitlab
>             contribution process.
>                  Is the process similar to ITK? And do you think I
>             should create a
>                  "ticket" or "bug report" for this little issue?
>
>                  If I can't get it to work (or if it takes me too much
>             time), I
>                  hope someone else can do the patch for me, next week
>             or so...
>
>                     Kind regards, Niels
>
>                  PS Also thanks to Audrius for the support  :-)
>
>                  Cory Quammen wrote on September 23, 2015, 15:54:
>
>                      Hi Niels,
>
>                      This does sound like a good patch. Would you mind
>             contributing
>                      it via
>                      our gitlab contribution process? Please see [1].
>
>                      [1]
>             https://gitlab.kitware.com/vtk/vtk/blob/master/CONTRIBUTING.md
>
>                      Thank you,
>                      Cory
>
>                      On Wed, Sep 23, 2015 at 9:46 AM, Niels Dekker wrote:
>
>                           Does anyone here think it would be nice to
>             fix these MSVC
>                      warnings?
>
>                           Basically it's just a matter of replacing
>             '/w' and '-w'
>                      by '/W0',
>                           in various CMake files of the VTK source
>             tree, according
>                      to the
>                           patch/diff-file I attached last Sunday.
>
>
>             --
>             Cory Quammen
>             R&D Engineer
>             Kitware, Inc.
>


More information about the vtkusers mailing list