MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Related Changesets ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0028452Open CASCADE[OCCT] OCCT:VISpublic2017-02-11 12:132018-06-29 21:19
Reporterabv 
Assigned Tobugmaster 
PrioritynormalSeverityminor 
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target Version[OCCT] 7.3.0Fixed in Version[OCCT] 7.3.0 
Summary0028452: VIS - MSVC 14 compiler warnings
DescriptionWhen OCCT is compiled with PCH (see 0028417), MSVC 14 reports multiple warnings in IVtk* packages:

Warning C4244 '=': conversion from 'vtkIdType' to 'int', possible loss of data TKIVtk D:\ABV\OCCT\occt\src\IVtkTools\IVtkTools_SubPolyDataFilter.cxx 77
Warning C4305 'argument': truncation from 'double' to 'float' TKIVtkDraw D:\ABV\OCCT\occt\src\IVtkDraw\IVtkDraw.cxx 370
Warning C4244 'argument': conversion from 'WPARAM' to 'UINT', possible loss of data TKIVtkDraw D:\ABV\OCCT\occt\src\IVtkDraw\IVtkDraw_Interactor.cxx 656
Warning C4244 'argument': conversion from 'WPARAM' to 'UINT', possible loss of data TKIVtkDraw D:\ABV\OCCT\occt\src\IVtkDraw\IVtkDraw_Interactor.cxx 659
Warning C4244 'argument': conversion from 'WPARAM' to 'UINT', possible loss of data TKIVtkDraw D:\ABV\OCCT\occt\src\IVtkDraw\IVtkDraw_Interactor.cxx 662
Warning C4244 'argument': conversion from 'WPARAM' to 'UINT', possible loss of data TKIVtkDraw D:\ABV\OCCT\occt\src\IVtkDraw\IVtkDraw_Interactor.cxx 665
Warning C4244 'argument': conversion from 'WPARAM' to 'UINT', possible loss of data TKIVtkDraw D:\ABV\OCCT\occt\src\IVtkDraw\IVtkDraw_Interactor.cxx 668
Warning C4244 'argument': conversion from 'WPARAM' to 'UINT', possible loss of data TKIVtkDraw D:\ABV\OCCT\occt\src\IVtkDraw\IVtkDraw_Interactor.cxx 671
Warning C4244 'argument': conversion from 'WPARAM' to 'UINT', possible loss of data TKIVtkDraw D:\ABV\OCCT\occt\src\IVtkDraw\IVtkDraw_Interactor.cxx 674
Warning C4244 'argument': conversion from 'WPARAM' to 'UINT', possible loss of data TKIVtkDraw D:\ABV\OCCT\occt\src\IVtkDraw\IVtkDraw_Interactor.cxx 677
Warning C4244 'argument': conversion from 'WPARAM' to 'UINT', possible loss of data TKIVtkDraw D:\ABV\OCCT\occt\src\IVtkDraw\IVtkDraw_Interactor.cxx 680
Warning C4244 'argument': conversion from 'WPARAM' to 'UINT', possible loss of data TKIVtkDraw D:\ABV\OCCT\occt\src\IVtkDraw\IVtkDraw_Interactor.cxx 683
Warning C4244 'argument': conversion from 'WPARAM' to 'UINT', possible loss of data TKIVtkDraw D:\ABV\OCCT\occt\src\IVtkDraw\IVtkDraw_Interactor.cxx 692
Warning C4244 'argument': conversion from 'WPARAM' to 'UINT', possible loss of data TKIVtkDraw D:\ABV\OCCT\occt\src\IVtkDraw\IVtkDraw_Interactor.cxx 702
Warning C4244 'argument': conversion from 'WPARAM' to 'UINT', possible loss of data TKIVtkDraw D:\ABV\OCCT\occt\src\IVtkDraw\IVtkDraw_Interactor.cxx 706
Warning C4244 'argument': conversion from 'WPARAM' to 'UINT', possible loss of data TKIVtkDraw D:\ABV\OCCT\occt\src\IVtkDraw\IVtkDraw_Interactor.cxx 711

The reason why these warnings are not detected in standard build is that VTK headers disable several warning messages globally. When PCH is used inclusion of corresponding headers is protected by #pragme warning pus/pop, and thus warning reporting is restored.
Steps To ReproduceWrap inclusion of VTK headers in relevant files:

#pragma warning(push)
#include .... VTK stuff...
#pragma warning(pop)

and build.

Alternatively, macro VTK_DISPLAY_WIN32_WARNINGS can be #defined before inclusion of VTK headers to prevent disabling warnings
TagsNo tags attached.
Test case numberNot required
Attached Files

- Relationships
parent of 0029128feedbacksan Open CASCADE Cross-platform macro for enabling compiler warnings suppressed by third-party products 
child of 0028417closedbugmaster Community Using PRECOMPILED HEADER to speed up compilation time 
Not all the children of this issue are yet resolved or closed.

-  Notes
(0069408)
git (administrator)
2017-08-15 16:04

Branch CR28452 has been created by abv.

SHA-1: 83ed97cf98cbc4977d321b520ff58cb107fced8b


Detailed log of new commits:

Author: abv
Date: Tue Aug 15 16:04:45 2017 +0300

    0028452: VIS - MSVC 14 compiler warnings
    
    Includes of VTK headers are wrapped in #pragmas to ensure that MSVC warning messages disabled by VTK headers are still enabled for OCCT code
(0069412)
git (administrator)
2017-08-15 16:38

Branch CR28452 has been updated forcibly by abv.

SHA-1: 08852a373b7995c53a179a4b0473fd96b9210411
(0069416)
git (administrator)
2017-08-15 17:41

Branch CR28452 has been updated forcibly by abv.

SHA-1: c8f26c089f64717f27c2a9dfd927491f0c189f5e
(0069424)
abv (manager)
2017-08-15 19:51
edited on: 2017-08-15 19:52

The code has been corrected to avoid compiler warnings in patch for 0028417.

Additional correction to prevent unintentional disabling of MSVC compiler warnings for OCCT code due to inclusion of VTK headers is pushed to branch CR28452, please review.

The compilation has passed on all platforms, see Jenkins job CR28452-master-abv; testing is not required (no changes in the functional code, only headers).

This is intended to be integrated after OCCT 7.2.0 release, to prevent possible tricky problems that may appear with not-yet-tried versions of VTK.

(0070334)
kgv (developer)
2017-09-08 09:52

Just an idea:
+// prevent disabling some MSVC warning messages by VTK headers 
+#ifdef _MSC_VER
+#pragma warning(push)
+#endif
 #include <vtkActor.h>
 #include <vtkPolyData.h>
 #include <vtkPolyDataMapper.h>
 #include <vtkRenderer.h>
 #include <vtkSmartPointer.h>
+#ifdef _MSC_VER
+#pragma warning(pop)
+#endif

this is repeated many times and specific too msvc, while VTK headers potentially might break diagnostic state within other compilers as well.
So it might be better defining a reusable pair of macros for pushing/popping warnings - see "#pragma GCC diagnostic push/pop" available in gcc 4.6+ and similar commands in CLang.
(0070718)
san (developer)
2017-09-20 19:04
edited on: 2017-09-20 19:20

Agreed to process 0028452:0070334 in a separate issue, see 0029128.

(0070719)
san (developer)
2017-09-20 19:21

Branch CR28452 reviewed without remarks, ready for testing.
(0070720)
bugmaster (administrator)
2017-09-20 19:27

Launched :

http://jenkins-test-10.nnov.opencascade.com/view/CR28452-master-INV/ [^]
(0070733)
bugmaster (administrator)
2017-09-21 12:35

it is suggested to test it after new master for OCCT and Products has been ready.
And fix has been rebased on latter
(0070760)
git (administrator)
2017-09-21 21:45

Branch CR28452 has been updated forcibly by inv.

SHA-1: 9e8037b864185fe52192c02f0d18a4f4524aa186
(0070792)
bugmaster (administrator)
2017-09-22 15:31
edited on: 2017-09-22 15:31

Combination -
OCCT branch : CR28452 SHA-1: 9e8037b864185fe52192c02f0d18a4f4524aa186
Products branch : master
was compiled on Linux, MacOS and Windows platforms and tested on optimize mode.

http://jenkins-test-10.nnov.opencascade.com/view/CR28452-master-INV/ [^]

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
No differences that require special attention

Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention

(0071002)
git (administrator)
2017-09-29 17:11

Branch CR28452 has been deleted by kgv.

SHA-1: 9e8037b864185fe52192c02f0d18a4f4524aa186

- Related Changesets
occt: master a9660929
Timestamp: 2017-08-15 13:04:45
Author: abv
Committer: bugmaster
Details ] Diff ]
0028452: VIS - MSVC 14 compiler warnings

Includes of VTK headers are wrapped in #pragmas to ensure that MSVC warning messages disabled by VTK headers are still enabled for OCCT code
mod - src/IVtkDraw/IVtkDraw.cxx Diff ] File ]
mod - src/IVtkDraw/IVtkDraw_HighlightAndSelectionPipeline.cxx Diff ] File ]
mod - src/IVtkDraw/IVtkDraw_HighlightAndSelectionPipeline.hxx Diff ] File ]
mod - src/IVtkDraw/IVtkDraw_Interactor.cxx Diff ] File ]
mod - src/IVtkDraw/IVtkDraw_Interactor.hxx Diff ] File ]
mod - src/IVtkTools/IVtkTools.cxx Diff ] File ]
mod - src/IVtkTools/IVtkTools_DisplayModeFilter.cxx Diff ] File ]
mod - src/IVtkTools/IVtkTools_ShapeDataSource.cxx Diff ] File ]
mod - src/IVtkTools/IVtkTools_ShapeObject.cxx Diff ] File ]
mod - src/IVtkTools/IVtkTools_ShapeObject.hxx Diff ] File ]
mod - src/IVtkTools/IVtkTools_ShapePicker.cxx Diff ] File ]
mod - src/IVtkTools/IVtkTools_ShapePicker.hxx Diff ] File ]
mod - src/IVtkTools/IVtkTools_SubPolyDataFilter.cxx Diff ] File ]
mod - src/IVtkVTK/IVtkVTK_ShapeData.cxx Diff ] File ]
mod - src/IVtkVTK/IVtkVTK_ShapeData.hxx Diff ] File ]
mod - src/IVtkVTK/IVtkVTK_View.cxx Diff ] File ]

- Issue History
Date Modified Username Field Change
2017-02-11 12:13 abv New Issue
2017-02-11 12:13 abv Assigned To => san
2017-03-06 16:40 abv Relationship added child of 0028417
2017-08-15 16:04 git Note Added: 0069408
2017-08-15 16:38 git Note Added: 0069412
2017-08-15 17:41 git Note Added: 0069416
2017-08-15 19:51 abv Note Added: 0069424
2017-08-15 19:51 abv Status new => resolved
2017-08-15 19:51 abv Target Version 7.2.0 => 7.3.0
2017-08-15 19:52 abv Note Edited: 0069424 View Revisions
2017-09-08 09:52 kgv Note Added: 0070334
2017-09-20 19:04 san Note Added: 0070718
2017-09-20 19:18 san Relationship added parent of 0029128
2017-09-20 19:20 san Note Edited: 0070718 View Revisions
2017-09-20 19:21 san Note Added: 0070719
2017-09-20 19:21 san Assigned To san => bugmaster
2017-09-20 19:21 san Status resolved => reviewed
2017-09-20 19:27 bugmaster Note Added: 0070720
2017-09-21 12:35 bugmaster Note Added: 0070733
2017-09-21 21:45 git Note Added: 0070760
2017-09-22 12:20 bugmaster Test case number => Not required
2017-09-22 15:31 bugmaster Note Added: 0070792
2017-09-22 15:31 bugmaster Status reviewed => tested
2017-09-22 15:31 bugmaster Note Edited: 0070792 View Revisions
2017-09-29 13:26 bugmaster Changeset attached => occt master a9660929
2017-09-29 13:26 bugmaster Status tested => verified
2017-09-29 13:26 bugmaster Resolution open => fixed
2017-09-29 17:11 git Note Added: 0071002
2018-02-08 23:25 abv Target Version 7.3.0 => 7.4.0*
2018-02-20 12:58 user533 Target Version 7.4.0* => 7.3.0
2018-06-29 21:15 user533 Fixed in Version => 7.3.0
2018-06-29 21:19 user533 Status verified => closed


Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker