View Issue Details

IDProjectCategoryView StatusLast Update
0031060Open CASCADEOCCT:Configurationpublic2020-12-02 17:12
Reporterabv Assigned Toabv  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Target Version7.5.0Fixed in Version7.5.0 
Summary0031060: Configuration - Support building with CLang compiler under VS 2019
DescriptionVisual Studio 2019 provides toolset "LLVM - clang-cl" that can be used to build OCCT with CLang as alternative to MSVC compiler
Steps To ReproduceWith CMake: when configuring, select "Visua; Studio 16 2019" and toolset "ClangCL"
TagsNo tags attached.
Test case numberNot needed

Relationships

related to 0030609 closedapn Coding - eliminate warnings issued by gcc 8.1.0 
related to 0031124 closedabv Configuration - linker errors when building with CLang on Windows 
related to 0031094 closedbugmaster Coding Rules, Image_Texture - eliminate GCC compiler warning -Wsign-compare 

Activities

git

2019-10-14 08:13

administrator   ~0088076

Branch CR31060 has been created by abv.

SHA-1: a7715eeb1c98169a91172f493f925b20e9ad8142


Detailed log of new commits:

Author: abv
Date: Fri Oct 11 22:04:02 2019 +0300

    0031060: Configuration - Support building with CLang compiler under VS 2019
    
    Build tools are updated to support building with Visual Studion 2019 toolset ClangCL (LLVM clang-cl):
    - In CMake builds, use of unsupported option "-std=c++0x" is avoided
    - Tool genconf recognizes availability of ClangCL toolset and proposes it in the list
    - Tool genproj recognizes new compiler specification VCVER=vclang and generates VS 2019 projects for it
    
    Note that vclang configuration puts binaries to folder "vc14" as it is compatible with vc14 CRT.
    
    Code is updated to build with Clang for Windows without errors and warnings:
    - In BVH classes, pure virtual destructors are replaced by empty ones, to avoid bogus compiler warning
    - In .lex files, pragmas are added to disable warnings in parser code
    - In OSD, signature of function _osd_wnt_set_error() is corrected to avoid warning on incorrect use of va_args (undefined behavior)
    - In OSD_Host, OSD_Parallel_TBB, warnings on usage of deprecated function are disabled
    - In Quantity_ColorRGBA and ViewerTest_CmdParser, incorrect use of predefined macro __FUNCTION__ assuming it was a string literal is avoided
    - In Standard_Macro.hxx, code is reordered to handle Clang for Windows appropriately
    - In AdvApp2Var_SysBase.hxx, inclusion of obsolete (MSVC-specific) header file is avoided
    - In BRepExtrema_SelfIntersection.hxx, missing Standard_EXPORT is added
    - In Standard_ErrorHandler.hxx, empty statements added to avoid warning on unused class fields
    
    Off-topic: corrections of some errors (uninitialized class fields) reported by VS Code Analysis in TKernel

Author: tiv
Date: Thu Sep 26 17:43:07 2019 +0300

    0030609: Coding - eliminate warnings issued by gcc 8.1.0
    
    Warnings issued by gcc 8.1.0 are eliminated.
    Some macros necessary for compiler detection and gcc warning's suppression are added to Standard_Macro.hxx header file.
    New function OSD_FunctionCast() is introduced to explicitly mark places where the conversion from the pointer to one function type to the pointer to another function type takes place and to suppress gcc warning "-Wcast-function-type".

abv

2019-10-14 20:54

manager   ~0088125

Fix is pushed to CR31060 and tested, see Jenkins job CR31060-abv; please review

kgv

2019-10-15 21:20

developer   ~0088148

-#if _MSC_VER
+
+#if defined(_MSC_VER) && _MSC_VER < 1600
 #include <stddef.h>
 #else
 #include <stdint.h>

It is better replacing the whole block with #include <Standard_TypeDef.hxx>

-    aWindowClass = new WNT_WClass ("GWVTK_Class", DefWindowProc,
+    aWindowClass = new WNT_WClass ("GWVTK_Class", (Standard_Address)DefWindowProc,

This conflicts with 0030609 stating that casing function to (void*) is undefined.
From another point, passing WNDPROC as LONG_PTR via documented GWLP_WNDPROC
SetWindowLongPtrW() suggests that WinAPI implementations have to allow putting function pointer into void* as LONG_PTR has the same size.

git

2019-10-17 07:45

administrator   ~0088208

Branch CR31060 has been updated by abv.

SHA-1: 64eddbf42883b2db6b7893b9feb52534ab06b906


Detailed log of new commits:

Author: abv
Date: Thu Oct 17 07:44:45 2019 +0300

    # correction of review remarks; documentation update

abv

2019-10-17 07:49

manager   ~0088209

Kirill,

Inclusion of stddef.h in AdvApp2Var_SysBase.hxx was apparently needed for type intptr_t, which is not defined by Standard_TypeDef.hxx. That is why it seems still necessary to have stddef.h for VS 2008. Sorry I cannot check that easily since I have no VS 2008 installed, can you?

There is no conflict with 0030609 - instead CR31060 is based on that patch! Note that description of 0030609 does not mention any situation as "undefined", you seem to have mixed it with something else. However, I agree that it is better to avoid cast at all -- this is corrected.

Please review again.

kgv

2019-10-17 09:04

developer   ~0088210

> Inclusion of stddef.h in AdvApp2Var_SysBase.hxx was apparently needed for type intptr_t, which is not defined by Standard_TypeDef.hxx.
> That is why it seems still necessary to have stddef.h for VS 2008.
stddef.h is already included by Standard_TypeDef.hxx.
Simple VS2008 project test shows no problem.

-    aWindowClass = new WNT_WClass ("GWVTK_Class", (Standard_Address)DefWindowProc,
+    aWindowClass = new WNT_WClass ("GWVTK_Class", DefWindowProc,

DefWindowProcW should be used instead.

git

2019-10-17 12:25

administrator   ~0088245

Branch CR31060_1 has been created by abv.

SHA-1: aaeb319eddf710e158f78faeb921f1245bb297bc


Detailed log of new commits:

Author: abv
Date: Fri Oct 11 22:04:02 2019 +0300

    0031060: Configuration - Support building with CLang compiler under VS 2019
    
    Build tools are updated to support building with Visual Studion 2019 toolset ClangCL (LLVM clang-cl):
    - In CMake builds, use of unsupported option "-std=c++0x" is avoided
    - Tool genconf recognizes availability of ClangCL toolset and proposes it in the list
    - Tool genproj recognizes new compiler specification VCVER=vclang and generates VS 2019 projects for it
    
    Note that vclang configuration puts binaries to folder "vc14" as it is compatible with vc14 CRT.
    
    Code is updated to build with Clang for Windows without errors and warnings:
    - In BVH classes, pure virtual destructors are replaced by empty ones, to avoid bogus compiler warning
    - In .lex files, pragmas are added to disable warnings in parser code
    - In OSD, signature of function _osd_wnt_set_error() is corrected to avoid warning on incorrect use of va_args (undefined behavior)
    - In OSD_Host, OSD_Parallel_TBB, warnings on usage of deprecated function are disabled
    - In Quantity_ColorRGBA and ViewerTest_CmdParser, incorrect use of predefined macro __FUNCTION__ assuming it was a string literal is avoided
    - In Standard_Macro.hxx, code is reordered to handle Clang for Windows appropriately
    - In AdvApp2Var_SysBase.hxx, inclusion of obsolete (MSVC-specific) header file is replaced by Standard_TypeDef.hxx
    - In BRepExtrema_SelfIntersection.hxx, missing Standard_EXPORT is added
    - In Standard_ErrorHandler.hxx, empty statements added to avoid warning on unused class fields
    - In IVtkDraw and ViewerTest, interface is corrected to use actual type avoiding unnecessary type casts
    
    Off-topic: corrections of some errors (uninitialized class fields) reported by VS Code Analysis in TKernel

abv

2019-10-17 14:23

manager   ~0088254

Remarks are taken into account, please review branch CR31060_1. Compilation in Jenkins went OK, see job CR31060-abv.

apn

2019-10-20 21:35

administrator   ~0088370

Last edited: 2019-10-20 21:37

There are following compilation errors:

Windows-64-Mingw-opt:
C:\builds\IR-2019-10-20_IR-2019-10-20\Windows-64-Mingw-opt\OCCT\src\OSD\OSD_Timer.cxx:55:18: error: 'GetTickCount64' was not declared in this scope
http://jenkins-test-08.nnov.opencascade.com/view/IR-2019-10-20_IR-2019-10-20/view/OCCT%20compile/job/IR-2019-10-20_IR-2019-10-20-OCCT-Windows-64-Mingw-opt-compile/1/parsed_console/

apn

2019-10-22 13:57

administrator   ~0088413

Windows-64-Mingw:
C:\builds\IR-2019-10-20_IR-2019-10-20\Windows-64-Mingw-opt\OCCT\src\ViewerTest\ViewerTest_ViewerCommands.cxx:1378:63: error: invalid conversion from 'LRESULT (*)(HWND, UINT, WPARAM, LPARAM) {aka long long int (*)(HWND__*, unsigned int, long long unsigned int, long long int)}' to 'Standard_Address {aka void*}' [-fpermissive]

http://jenkins-test-08.nnov.opencascade.com/view/IR-2019-10-20_IR-2019-10-20/view/OCCT%20compile/job/IR-2019-10-20_IR-2019-10-20-OCCT-Windows-64-Mingw-opt-compile/3/parsed_console/

git

2019-10-23 11:03

administrator   ~0088443

Branch CR31060_3 has been created by abv.

SHA-1: bac1c12ed05ac3bc9e18bf7e14747726807ed4aa


Detailed log of new commits:

Author: abv
Date: Fri Oct 11 22:04:02 2019 +0300

    0031060: Configuration - Support building with CLang compiler under VS 2019
    
    Build tools are updated to support building with Visual Studion 2019 toolset ClangCL (LLVM clang-cl):
    - In CMake builds, use of unsupported option "-std=c++0x" is avoided
    - Tool genconf recognizes availability of ClangCL toolset and proposes it in the list
    - Tool genproj recognizes new compiler specification VCVER=vclang and generates VS 2019 projects for it
    
    Note that vclang configuration puts binaries to folder "vc14" as it is compatible with vc14 CRT.
    
    Code is updated to build with Clang for Windows without errors and warnings:
    - In BVH classes, pure virtual destructors are replaced by empty ones, to avoid bogus compiler warning
    - In .lex files, pragmas are added to disable warnings in parser code
    - In OSD, signature of function _osd_wnt_set_error() is corrected to avoid warning on incorrect use of va_args (undefined behavior)
    - In OSD_Host, OSD_Parallel_TBB, warnings on usage of deprecated function are disabled
    - In Quantity_ColorRGBA and ViewerTest_CmdParser, incorrect use of predefined macro __FUNCTION__ assuming it was a string literal is avoided
    - In Standard_Macro.hxx, code is reordered to handle Clang for Windows appropriately
    - In AdvApp2Var_SysBase.hxx, inclusion of obsolete (MSVC-specific) header file is replaced by Standard_TypeDef.hxx
    - In BRepExtrema_SelfIntersection.hxx, missing Standard_EXPORT is added
    - In Standard_ErrorHandler.hxx, empty statements added to avoid warning on unused class fields
    - In IVtkDraw and ViewerTest, interface is corrected to use actual type avoiding unnecessary type casts
    
    Off-topic: corrections of some errors (uninitialized class fields) reported by VS Code Analysis in TKernel

git

2019-11-03 21:52

administrator   ~0088711

Branch CR31060_3 has been updated forcibly by abv.

SHA-1: 1bd04b5a02c9d940988ec52bc7fd2673a7045188

abv

2019-11-04 15:31

manager   ~0088716

The compiler errors have been corrected, please consider branch CR31060_3 for integration (together with CR31124)

bugmaster

2019-11-07 10:43

administrator   ~0088764

Tested in framework of WEEK-45

Combination -
OCCT branch : WEEK-45
master SHA - a1a9b249523438cf9b3d510fb4ff74bd4a5675b6
5f5b1aed1c6e139bbd34314eca77ae7abcd8895c
Products branch : WEEK-45 SHA - f88bc93e3637c4c42f3c154c0b0e167d4e297ae6
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian80-64:
OCCT
Total CPU difference: 16844.70000000007 / 16848.430000000117 [-0.02%]
Products
Total CPU difference: 10837.970000000065 / 10873.690000000062 [-0.33%]
Windows-64-VC14:
OCCT
Total CPU difference: 18366.671875 / 18319.515625 [+0.26%]
Products
Total CPU difference: 12848.578125 / 12848.859375 [-0.00%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention

git

2019-11-10 11:41

administrator   ~0088839

Branch CR31060_3 has been deleted by inv.

SHA-1: 1bd04b5a02c9d940988ec52bc7fd2673a7045188

git

2019-11-10 11:42

administrator   ~0088868

Branch CR31060_1 has been deleted by inv.

SHA-1: aaeb319eddf710e158f78faeb921f1245bb297bc

git

2019-11-10 11:42

administrator   ~0088870

Branch CR31060 has been deleted by inv.

SHA-1: 64eddbf42883b2db6b7893b9feb52534ab06b906

Related Changesets

occt: master 1bd04b5a

2019-10-11 19:04:02

abv


Committer: abv Details Diff
0031060: Configuration - Support building with CLang compiler under VS 2019

Build tools are updated to support building with Visual Studion 2019 toolset ClangCL (LLVM clang-cl):
- In CMake builds, use of unsupported option "-std=c++0x" is avoided
- Tool genconf recognizes availability of ClangCL toolset and proposes it in the list
- Tool genproj recognizes new compiler specification VCVER=vclang and generates VS 2019 projects for it

Note that vclang configuration puts binaries to folder "vc14" as it is compatible with vc14 CRT.

Code is updated to build with Clang for Windows without errors and warnings:
- In BVH classes, pure virtual destructors are replaced by empty ones, to avoid bogus compiler warning
- In .lex files, pragmas are added to disable warnings in parser code
- In OSD, signature of function _osd_wnt_set_error() is corrected to avoid warning on incorrect use of va_args (undefined behavior)
- In OSD_Host, OSD_Parallel_TBB, warnings on usage of deprecated function are disabled
- In Quantity_ColorRGBA and ViewerTest_CmdParser, incorrect use of predefined macro __FUNCTION__ assuming it was a string literal is avoided
- In Standard_Macro.hxx, code is reordered to handle Clang for Windows appropriately
- In AdvApp2Var_SysBase.hxx, inclusion of obsolete (MSVC-specific) header file is replaced by Standard_TypeDef.hxx
- In Standard_ErrorHandler.hxx, empty statements added to avoid warning on unused class fields
- In IVtkDraw and ViewerTest, interface is corrected to use actual type avoiding unnecessary type casts

Off-topic: corrections of some errors (uninitialized class fields) reported by VS Code Analysis in TKernel
Affected Issues
0031060
mod - adm/cmake/occt_defs_flags.cmake Diff File
mod - adm/genconf.tcl Diff File
mod - adm/genconfdeps.tcl Diff File
mod - adm/genproj.tcl Diff File
mod - adm/templates/env.bat Diff File
mod - dox/overview/overview.md Diff File
mod - src/AdvApp2Var/AdvApp2Var_SysBase.hxx Diff File
mod - src/BinLDrivers/BinLDrivers_DocumentStorageDriver.cxx Diff File
mod - src/BVH/BVH_Object.hxx Diff File
mod - src/BVH/BVH_QueueBuilder.hxx Diff File
mod - src/BVH/BVH_Set.hxx Diff File
mod - src/ExprIntrp/ExprIntrp.lex Diff File
mod - src/ExprIntrp/lex.ExprIntrp.c Diff File
mod - src/Image/Image_Texture.cxx Diff File
mod - src/IVtkDraw/IVtkDraw.cxx Diff File
mod - src/IVtkDraw/IVtkDraw.hxx Diff File
mod - src/IVtkDraw/IVtkDraw_Interactor.cxx Diff File
mod - src/NCollection/NCollection_AccAllocator.hxx Diff File
mod - src/NCollection/NCollection_SparseArrayBase.hxx Diff File
mod - src/OSD/OSD_Directory.cxx Diff File
mod - src/OSD/OSD_DirectoryIterator.cxx Diff File
mod - src/OSD/OSD_Disk.cxx Diff File
mod - src/OSD/OSD_File.cxx Diff File
mod - src/OSD/OSD_FileIterator.cxx Diff File
mod - src/OSD/OSD_FileNode.cxx Diff File
mod - src/OSD/OSD_Host.cxx Diff File
mod - src/OSD/OSD_Parallel_TBB.cxx Diff File
mod - src/OSD/OSD_Path.cxx Diff File
mod - src/OSD/OSD_Process.cxx Diff File
mod - src/OSD/OSD_Timer.cxx Diff File
mod - src/QABugs/QABugs_11.cxx Diff File
mod - src/QABugs/QABugs_19.cxx Diff File
mod - src/Quantity/Quantity_ColorRGBA.cxx Diff File
mod - src/Standard/Standard_ErrorHandler.hxx Diff File
mod - src/Standard/Standard_Macro.hxx Diff File
mod - src/StepFile/lex.step.c Diff File
mod - src/StepFile/step.lex Diff File
mod - src/Storage/Storage_Schema.cxx Diff File
mod - src/ViewerTest/ViewerTest.hxx Diff File
mod - src/ViewerTest/ViewerTest_CmdParser.cxx Diff File
mod - src/ViewerTest/ViewerTest_ViewerCommands.cxx Diff File

Issue History

Date Modified Username Field Change
2019-10-11 21:59 abv New Issue
2019-10-11 21:59 abv Assigned To => bugmaster
2019-10-11 22:48 abv Steps to Reproduce Updated
2019-10-14 08:13 git Note Added: 0088076
2019-10-14 20:54 abv Note Added: 0088125
2019-10-14 20:54 abv Status new => resolved
2019-10-15 20:50 abv Assigned To bugmaster => kgv
2019-10-15 21:20 kgv Note Added: 0088148
2019-10-15 21:36 kgv Assigned To kgv => abv
2019-10-15 21:36 kgv Status resolved => assigned
2019-10-17 07:45 git Note Added: 0088208
2019-10-17 07:49 abv Note Added: 0088209
2019-10-17 07:49 abv Assigned To abv => bugmaster
2019-10-17 07:49 abv Status assigned => resolved
2019-10-17 09:04 kgv Note Added: 0088210
2019-10-17 09:04 kgv Assigned To bugmaster => abv
2019-10-17 09:04 kgv Status resolved => assigned
2019-10-17 12:25 git Note Added: 0088245
2019-10-17 14:23 abv Note Added: 0088254
2019-10-17 14:23 abv Assigned To abv => bugmaster
2019-10-17 14:23 abv Status assigned => resolved
2019-10-17 14:23 abv Relationship added related to 0030609
2019-10-17 14:34 kgv Status resolved => reviewed
2019-10-20 21:35 apn Note Added: 0088370
2019-10-20 21:37 apn Note Edited: 0088370
2019-10-20 21:37 apn Test case number => Not needed
2019-10-20 21:37 apn Assigned To bugmaster => abv
2019-10-20 21:37 apn Status reviewed => assigned
2019-10-22 13:57 apn Note Added: 0088413
2019-10-23 11:03 git Note Added: 0088443
2019-11-03 21:52 git Note Added: 0088711
2019-11-04 15:31 abv Note Added: 0088716
2019-11-04 15:31 abv Assigned To abv => bugmaster
2019-11-04 15:31 abv Status assigned => resolved
2019-11-04 15:31 abv Status resolved => reviewed
2019-11-04 22:26 abv Relationship added related to 0031124
2019-11-07 10:43 bugmaster Note Added: 0088764
2019-11-07 10:43 bugmaster Status reviewed => tested
2019-11-10 11:18 abv Changeset attached => occt master 1bd04b5a
2019-11-10 11:18 abv Assigned To bugmaster => abv
2019-11-10 11:18 abv Status tested => verified
2019-11-10 11:18 abv Resolution open => fixed
2019-11-10 11:41 git Note Added: 0088839
2019-11-10 11:42 git Note Added: 0088868
2019-11-10 11:42 git Note Added: 0088870
2020-06-01 11:17 kgv Relationship added related to 0031094
2020-12-02 16:40 emo Fixed in Version => 7.5.0
2020-12-02 17:12 emo Status verified => closed