1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

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
This commit is contained in:
abv
2019-10-11 22:04:02 +03:00
parent 6466cc9eb1
commit 1bd04b5a02
41 changed files with 134 additions and 100 deletions

View File

@@ -75,7 +75,7 @@ protected:
{
Standard_Size myValue;
public:
AlignedSize(){}
AlignedSize() : myValue(0) {}
AlignedSize(const Standard_Size theValue)
: myValue((theValue + Align - 1) & ~(Align - 1)) {}
operator Standard_Size() const {return myValue;}
@@ -86,7 +86,7 @@ protected:
{
Standard_Byte* myValue;
public:
AlignedPtr(){}
AlignedPtr() : myValue(0) {}
AlignedPtr(const Standard_Address theValue)
: myValue((Standard_Byte*)((Standard_Size)theValue & ~(Align - 1))) {}
operator Standard_Address () const {return myValue;}

View File

@@ -190,8 +190,8 @@ public:
private:
// Copy constructor and assignment operator are private thus not accessible
NCollection_SparseArrayBase (const NCollection_SparseArrayBase&) {}
void operator = (const NCollection_SparseArrayBase&) {}
NCollection_SparseArrayBase(const NCollection_SparseArrayBase&);
void operator = (const NCollection_SparseArrayBase&);
protected:
// Object life