View Issue Details

IDProjectCategoryView StatusLast Update
0028452Open CASCADEOCCT:VISpublic2018-06-29 21:19
ReporterabvAssigned Tobugmaster  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Target Version7.3.0Fixed in Version7.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

Relationships

parent of 0029128 closedsan Open CASCADE Cross-platform macro for enabling compiler warnings suppressed by third-party products 
child of 0028417 closedbugmaster Community Using PRECOMPILED HEADER to speed up compilation time 

Activities

git

2017-08-15 16:04

administrator   ~0069408

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

git

2017-08-15 16:38

administrator   ~0069412

Branch CR28452 has been updated forcibly by abv.

SHA-1: 08852a373b7995c53a179a4b0473fd96b9210411

git

2017-08-15 17:41

administrator   ~0069416

Branch CR28452 has been updated forcibly by abv.

SHA-1: c8f26c089f64717f27c2a9dfd927491f0c189f5e

abv

2017-08-15 19:51

manager   ~0069424

Last edited: 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.

kgv

2017-09-08 09:52

developer   ~0070334

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.

san

2017-09-20 19:04

developer   ~0070718

Last edited: 2017-09-20 19:20

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

san

2017-09-20 19:21

developer   ~0070719

Branch CR28452 reviewed without remarks, ready for testing.

bugmaster

2017-09-20 19:27

administrator   ~0070720

Launched :

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

bugmaster

2017-09-21 12:35

administrator   ~0070733

it is suggested to test it after new master for OCCT and Products has been ready.
And fix has been rebased on latter

git

2017-09-21 21:45

administrator   ~0070760

Branch CR28452 has been updated forcibly by inv.

SHA-1: 9e8037b864185fe52192c02f0d18a4f4524aa186

bugmaster

2017-09-22 15:31

administrator   ~0070792

Last edited: 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

git

2017-09-29 17:11

administrator   ~0071002

Branch CR28452 has been deleted by kgv.

SHA-1: 9e8037b864185fe52192c02f0d18a4f4524aa186

Related Changesets

occt: master a9660929

2017-08-15 13:04:45

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
Affected Issues
0028452
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
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
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
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 aiv Target Version 7.4.0 => 7.3.0
2018-06-29 21:15 aiv Fixed in Version => 7.3.0
2018-06-29 21:19 aiv Status verified => closed