Archived issue #0030609

Coding - eliminate warnings issued by gcc 8.1.0

Open CASCADEOCCT:Codingclosed52 public notes

Search issues

Description

A bunch of warnings are issued by the latest g++ version 8.1.0. The warning log is attached (named "Attachment 2 (WARNINGS)").

\occt_mingw64\src\OSD\OSD_Parallel.cxx: In function 'bool {anonymous}::isWow64()':
\occt_mingw64\src\OSD\OSD_Parallel.cxx:45:76: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'LPFN_ISWOW64PROCESS' {aka 'int (*)(void*, int*)'} [-Wcast-function-type]
       : (LPFN_ISWOW64PROCESS)GetProcAddress(aKern32Module, "IsWow64Process");
                                                                            ^
\occt_mingw64\src\OSD\OSD_Parallel.cxx: In static member function 'static Standard_Integer OSD_Parallel::NbLogicalProcessors()':
\occt_mingw64\src\OSD\OSD_Parallel.cxx:224:85: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'LPFN_GSI' {aka 'int (*)(_SYSTEM_INFO*)'} [-Wcast-function-type]
     LPFN_GSI aFuncSysInfo = (LPFN_GSI )GetProcAddress(aKern32, "GetNativeSystemInfo");
                                                                                     ^
\occt_mingw64\src\OSD\OSD_signal.cxx: In function 'void SIGWntHandler(int, int)':
\occt_mingw64\src\OSD\OSD_signal.cxx:284:43: warning: cast between incompatible function types from 'void (*)(int, int)' to 'void (*)(int)' [-Wcast-function-type]
       if ( signal( signum , (void(*)(int))SIGWntHandler ) == SIG_ERR )
                                           ^~~~~~~~~~~~~
\occt_mingw64\src\OSD\OSD_signal.cxx:312:42: warning: cast between incompatible function types from 'void (*)(int, int)' to 'void (*)(int)' [-Wcast-function-type]
       if ( signal( signum, (void(*)(int))SIGWntHandler ) == SIG_ERR )
                                          ^~~~~~~~~~~~~
\occt_mingw64\src\OSD\OSD_signal.cxx:317:42: warning: cast between incompatible function types from 'void (*)(int, int)' to 'void (*)(int)' [-Wcast-function-type]
       if ( signal( signum, (void(*)(int))SIGWntHandler ) == SIG_ERR )
                                          ^~~~~~~~~~~~~
\occt_mingw64\src\OSD\OSD_signal.cxx: In static member function 'static void OSD::SetSignal(Standard_Boolean)':
\occt_mingw64\src\OSD\OSD_signal.cxx:399:38: warning: cast between incompatible function types from 'void (*)(int, int)' to 'void (*)(int)' [-Wcast-function-type]
   if (signal (SIGSEGV, (void(*)(int))SIGWntHandler) == SIG_ERR)
                                      ^~~~~~~~~~~~~
\occt_mingw64\src\OSD\OSD_signal.cxx:401:38: warning: cast between incompatible function types from 'void (*)(int, int)' to 'void (*)(int)' [-Wcast-function-type]
   if (signal (SIGFPE,  (void(*)(int))SIGWntHandler) == SIG_ERR)
                                      ^~~~~~~~~~~~~
\occt_mingw64\src\OSD\OSD_signal.cxx:403:38: warning: cast between incompatible function types from 'void (*)(int, int)' to 'void (*)(int)' [-Wcast-function-type]
   if (signal (SIGILL,  (void(*)(int))SIGWntHandler) == SIG_ERR)
                                      ^~~~~~~~~~~~~
\occt_mingw64\src\OSD\OSD_SharedLibrary.cxx: In member function 'int (* OSD_SharedLibrary::DlSymb(Standard_CString) const)(...)':
\occt_mingw64\src\OSD\OSD_SharedLibrary.cxx:269:83: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'OSD_Function' {aka 'int (*)(...)'} [-Wcast-function-type]
  OSD_Function func = ( OSD_Function )GetProcAddress (  ( HMODULE )myHandle, Name  );
                                                                                   ^
\occt_mingw64\src\OSD\OSD_WNT.cxx: In function 'BOOL MoveDirectory(const wchar_t*, const wchar_t*, DWORD&)':
\occt_mingw64\src\OSD\OSD_WNT.cxx:702:46: warning: division 'sizeof (const wchar_t*) / sizeof (const wchar_t)' does not compute the number of array elements [-Wsizeof-pointer-div]
     StringCchLengthW (oldDir, sizeof(oldDir) / sizeof(oldDir[0]), &anOldDirLength);
                               ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
\occt_mingw64\src\OSD\OSD_WNT.cxx:619:43: note: first 'sizeof' operand was declared here
 static BOOL MoveDirectory (const wchar_t* oldDir, const wchar_t* newDir, DWORD& theRecurseLevel)
                            ~~~~~~~~~~~~~~~^~~~~~
\occt_mingw64\src\OSD\OSD_WNT.cxx:706:44: warning: division 'sizeof (wchar_t*) / sizeof (wchar_t)' does not compute the number of array elements [-Wsizeof-pointer-div]
       StringCchCopyW (pName, sizeof(pName) / sizeof(pName[0]), oldDir);
                              ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
\occt_mingw64\src\OSD\OSD_WNT.cxx:694:12: note: first 'sizeof' operand was declared here
   wchar_t* pName = NULL;
            ^~~~~
\occt_mingw64\src\OSD\OSD_WNT.cxx:719:50: warning: division 'sizeof (const wchar_t*) / sizeof (const wchar_t)' does not compute the number of array elements [-Wsizeof-pointer-div]
         StringCchLengthW (oldDir, sizeof(oldDir) / sizeof(oldDir[0]), &anOldDirLength2);
                                   ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
\occt_mingw64\src\OSD\OSD_WNT.cxx:619:43: note: first 'sizeof' operand was declared here
 static BOOL MoveDirectory (const wchar_t* oldDir, const wchar_t* newDir, DWORD& theRecurseLevel)
                            ~~~~~~~~~~~~~~~^~~~~~
\occt_mingw64\src\OSD\OSD_WNT.cxx:720:50: warning: division 'sizeof (const wchar_t*) / sizeof (const wchar_t)' does not compute the number of array elements [-Wsizeof-pointer-div]
         StringCchLengthW (newDir, sizeof(newDir) / sizeof(newDir[0]), &aNewDirLength);
                                   ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
\occt_mingw64\src\OSD\OSD_WNT.cxx:619:66: note: first 'sizeof' operand was declared here
 static BOOL MoveDirectory (const wchar_t* oldDir, const wchar_t* newDir, DWORD& theRecurseLevel)
                                                   ~~~~~~~~~~~~~~~^~~~~~
\occt_mingw64\src\OSD\OSD_WNT.cxx:728:60: warning: division 'sizeof (wchar_t*) / sizeof (wchar_t)' does not compute the number of array elements [-Wsizeof-pointer-div]
         StringCchCopyW (pFullNameSrc, sizeof(pFullNameSrc) / sizeof(pFullNameSrc[0]), oldDir);
                                       ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
\occt_mingw64\src\OSD\OSD_WNT.cxx:695:12: note: first 'sizeof' operand was declared here
   wchar_t* pFullNameSrc = NULL;
            ^~~~~~~~~~~~
\occt_mingw64\src\OSD\OSD_WNT.cxx:729:60: warning: division 'sizeof (wchar_t*) / sizeof (wchar_t)' does not compute the number of array elements [-Wsizeof-pointer-div]
         StringCchCatW  (pFullNameSrc, sizeof(pFullNameSrc) / sizeof(pFullNameSrc[0]), L"/");
                                       ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
\occt_mingw64\src\OSD\OSD_WNT.cxx:695:12: note: first 'sizeof' operand was declared here
   wchar_t* pFullNameSrc = NULL;
            ^~~~~~~~~~~~
\occt_mingw64\src\OSD\OSD_WNT.cxx:730:60: warning: division 'sizeof (wchar_t*) / sizeof (wchar_t)' does not compute the number of array elements [-Wsizeof-pointer-div]
         StringCchCatW  (pFullNameSrc, sizeof(pFullNameSrc) / sizeof(pFullNameSrc[0]), pFD->cFileName);
                                       ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
\occt_mingw64\src\OSD\OSD_WNT.cxx:695:12: note: first 'sizeof' operand was declared here
   wchar_t* pFullNameSrc = NULL;
            ^~~~~~~~~~~~
\occt_mingw64\src\OSD\OSD_WNT.cxx:732:60: warning: division 'sizeof (wchar_t*) / sizeof (wchar_t)' does not compute the number of array elements [-Wsizeof-pointer-div]
         StringCchCopyW (pFullNameDst, sizeof(pFullNameDst) / sizeof(pFullNameDst[0]), newDir);
                                       ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
\occt_mingw64\src\OSD\OSD_WNT.cxx:696:12: note: first 'sizeof' operand was declared here
   wchar_t* pFullNameDst = NULL;
            ^~~~~~~~~~~~
\occt_mingw64\src\OSD\OSD_WNT.cxx:733:60: warning: division 'sizeof (wchar_t*) / sizeof (wchar_t)' does not compute the number of array elements [-Wsizeof-pointer-div]
         StringCchCatW  (pFullNameDst, sizeof(pFullNameDst) / sizeof(pFullNameDst[0]), L"/");
                                       ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
\occt_mingw64\src\OSD\OSD_WNT.cxx:696:12: note: first 'sizeof' operand was declared here
   wchar_t* pFullNameDst = NULL;
            ^~~~~~~~~~~~
\occt_mingw64\src\OSD\OSD_WNT.cxx:734:60: warning: division 'sizeof (wchar_t*) / sizeof (wchar_t)' does not compute the number of array elements [-Wsizeof-pointer-div]
         StringCchCatW  (pFullNameDst, sizeof(pFullNameDst) / sizeof(pFullNameDst[0]), pFD->cFileName);
                                       ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
\occt_mingw64\src\OSD\OSD_WNT.cxx:696:12: note: first 'sizeof' operand was declared here
   wchar_t* pFullNameDst = NULL;
            ^~~~~~~~~~~~
\occt_mingw64\src\OSD\OSD_WNT.cxx: In function 'BOOL CopyDirectory(const wchar_t*, const wchar_t*)':
\occt_mingw64\src\OSD\OSD_WNT.cxx:856:46: warning: division 'sizeof (const wchar_t*) / sizeof (const wchar_t)' does not compute the number of array elements [-Wsizeof-pointer-div]
     StringCchLengthW (dirSrc, sizeof(dirSrc) / sizeof(dirSrc[0]), &aDirSrcLength);
                               ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
\occt_mingw64\src\OSD\OSD_WNT.cxx:844:36: note: first 'sizeof' operand was declared here
 BOOL CopyDirectory (const wchar_t* dirSrc, const wchar_t* dirDst)
                     ~~~~~~~~~~~~~~~^~~~~~
\occt_mingw64\src\OSD\OSD_WNT.cxx:860:43: warning: division 'sizeof (wchar_t*) / sizeof (wchar_t)' does not compute the number of array elements [-Wsizeof-pointer-div]
       StringCchCopyW(pName, sizeof(pName) / sizeof(pName[0]), dirSrc);
                             ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
\occt_mingw64\src\OSD\OSD_WNT.cxx:847:12: note: first 'sizeof' operand was declared here
   wchar_t* pName = NULL;
            ^~~~~
\occt_mingw64\src\OSD\OSD_WNT.cxx:861:43: warning: division 'sizeof (wchar_t*) / sizeof (wchar_t)' does not compute the number of array elements [-Wsizeof-pointer-div]
       StringCchCatW (pName, sizeof(pName) / sizeof(pName[0]), WILD_CARD);
                             ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
\occt_mingw64\src\OSD\OSD_WNT.cxx:847:12: note: first 'sizeof' operand was declared here
   wchar_t* pName = NULL;
            ^~~~~
\occt_mingw64\src\OSD\OSD_WNT.cxx:874:50: warning: division 'sizeof (const wchar_t*) / sizeof (const wchar_t)' does not compute the number of array elements [-Wsizeof-pointer-div]
         StringCchLengthW (dirSrc, sizeof(dirSrc) / sizeof(dirSrc[0]), &aDirSrcLength2);
                                   ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
\occt_mingw64\src\OSD\OSD_WNT.cxx:844:36: note: first 'sizeof' operand was declared here
 BOOL CopyDirectory (const wchar_t* dirSrc, const wchar_t* dirDst)
                     ~~~~~~~~~~~~~~~^~~~~~
\occt_mingw64\src\OSD\OSD_WNT.cxx:875:50: warning: division 'sizeof (const wchar_t*) / sizeof (const wchar_t)' does not compute the number of array elements [-Wsizeof-pointer-div]
         StringCchLengthW (dirDst, sizeof(dirDst) / sizeof(dirDst[0]), &aDirDstLength);
                                   ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
\occt_mingw64\src\OSD\OSD_WNT.cxx:844:59: note: first 'sizeof' operand was declared here
 BOOL CopyDirectory (const wchar_t* dirSrc, const wchar_t* dirDst)
                                            ~~~~~~~~~~~~~~~^~~~~~
\occt_mingw64\src\OSD\OSD_WNT.cxx:883:60: warning: division 'sizeof (wchar_t*) / sizeof (wchar_t)' does not compute the number of array elements [-Wsizeof-pointer-div]
         StringCchCopyW (pFullNameSrc, sizeof(pFullNameSrc) / sizeof(pFullNameSrc[0]), dirSrc);
                                       ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
\occt_mingw64\src\OSD\OSD_WNT.cxx:848:12: note: first 'sizeof' operand was declared here
   wchar_t* pFullNameSrc = NULL;
            ^~~~~~~~~~~~
\occt_mingw64\src\OSD\OSD_WNT.cxx:884:60: warning: division 'sizeof (wchar_t*) / sizeof (wchar_t)' does not compute the number of array elements [-Wsizeof-pointer-div]
         StringCchCatW  (pFullNameSrc, sizeof(pFullNameSrc) / sizeof(pFullNameSrc[0]), L"/");
                                       ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
\occt_mingw64\src\OSD\OSD_WNT.cxx:848:12: note: first 'sizeof' operand was declared here
   wchar_t* pFullNameSrc = NULL;
            ^~~~~~~~~~~~
\occt_mingw64\src\OSD\OSD_WNT.cxx:885:60: warning: division 'sizeof (wchar_t*) / sizeof (wchar_t)' does not compute the number of array elements [-Wsizeof-pointer-div]
         StringCchCatW  (pFullNameSrc, sizeof(pFullNameSrc) / sizeof(pFullNameSrc[0]), pFD->cFileName);
                                       ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
\occt_mingw64\src\OSD\OSD_WNT.cxx:848:12: note: first 'sizeof' operand was declared here
   wchar_t* pFullNameSrc = NULL;
            ^~~~~~~~~~~~
\occt_mingw64\src\OSD\OSD_WNT.cxx:887:60: warning: division 'sizeof (wchar_t*) / sizeof (wchar_t)' does not compute the number of array elements [-Wsizeof-pointer-div]
         StringCchCopyW (pFullNameDst, sizeof(pFullNameDst) / sizeof(pFullNameDst[0]), dirDst);
                                       ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
\occt_mingw64\src\OSD\OSD_WNT.cxx:849:12: note: first 'sizeof' operand was declared here
   wchar_t* pFullNameDst = NULL;
            ^~~~~~~~~~~~
\occt_mingw64\src\OSD\OSD_WNT.cxx:888:60: warning: division 'sizeof (wchar_t*) / sizeof (wchar_t)' does not compute the number of array elements [-Wsizeof-pointer-div]
         StringCchCatW  (pFullNameDst, sizeof(pFullNameDst) / sizeof(pFullNameDst[0]), L"/");
                                       ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
\occt_mingw64\src\OSD\OSD_WNT.cxx:849:12: note: first 'sizeof' operand was declared here
   wchar_t* pFullNameDst = NULL;
            ^~~~~~~~~~~~
\occt_mingw64\src\OSD\OSD_WNT.cxx:889:60: warning: division 'sizeof (wchar_t*) / sizeof (wchar_t)' does not compute the number of array elements [-Wsizeof-pointer-div]
         StringCchCatW  (pFullNameDst, sizeof(pFullNameDst) / sizeof(pFullNameDst[0]), pFD->cFileName);
                                       ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
\occt_mingw64\src\OSD\OSD_WNT.cxx:849:12: note: first 'sizeof' operand was declared here
   wchar_t* pFullNameDst = NULL;
            ^~~~~~~~~~~~
\occt_mingw64\src\Plugin\Plugin.cxx: In static member function 'static opencascade::handle<Standard_Transient> Plugin::Load(const Standard_GUID&, Standard_Boolean)':
\occt_mingw64\src\Plugin\Plugin.cxx:97:56: warning: cast between incompatible function types from 'OSD_Function' {aka 'int (*)(...)'} to 'Standard_Transient* (*)(const Standard_GUID&)' [-Wcast-function-type]
   fp = (Standard_Transient* (*)(const Standard_GUID&)) f;
                                                        ^
\occt_mingw64\src\Message\Message_MsgFile.cxx: In static member function 'static Standard_Boolean Message_MsgFile::LoadFile(Standard_CString)':
\occt_mingw64\src\Message\Message_MsgFile.cxx:260:85: warning: type qualifiers ignored on cast result type [-Wignored-qualifiers]
         reinterpret_cast<const Standard_ExtCharacter* const>(&anMsgBuffer[aFileSize]);
                                                                                     ^
\occt_mingw64\src\Draw\Draw.cxx: In function 'void Draw_Appli(HINSTANCE, HINSTANCE, int, int, wchar_t**, FDraw_InitAppli)':
\occt_mingw64\src\Draw\Draw.cxx:281:102: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'SetDllDirectoryW_t' {aka 'int (*)(const wchar_t*)'} [-Wcast-function-type]
                              ? (SetDllDirectoryW_t )GetProcAddress (aKern32Module, "SetDllDirectoryW") : NULL;
                                                                                                      ^
\occt_mingw64\src\Draw\Draw.cxx: In static member function 'static void Draw::Load(Draw_Interpretor&, const TCollection_AsciiString&, const TCollection_AsciiString&, TCollection_AsciiString&, TCollection_AsciiString&, Standard_Boolean)':
\occt_mingw64\src\Draw\Draw.cxx:728:38: warning: cast between incompatible function types from 'OSD_Function' {aka 'int (*)(...)'} to 'void (*)(Draw_Interpretor&)' [-Wcast-function-type]
   fp = (void (*)(Draw_Interpretor&)) f;
                                      ^
\occt_mingw64\src\Draw\Draw_Window.cxx: In function 'Standard_Boolean Init_Appli(HINSTANCE, HINSTANCE, int, HWND__*&)':
\occt_mingw64\src\Draw\Draw_Window.cxx:2032:53: warning: cast between incompatible function types from 'DWORD (*)()' {aka 'long unsigned int (*)()'} to 'LPTHREAD_START_ROUTINE' {aka 'long unsigned int (*)(void*)'} [-Wcast-function-type]
                            (LPTHREAD_START_ROUTINE) tkLoop, // thread function
                                                     ^~~~~~
\occt_mingw64\src\Draw\Draw_Window.cxx: In function 'DWORD tkLoop()':
\occt_mingw64\src\Draw\Draw_Window.cxx:2312:12: warning: catching polymorphic type 'class Standard_Failure' by value [-Wcatch-value=]
     catch (Standard_Failure)
            ^~~~~~~~~~~~~~~~
\occt_mingw64\src\Draw\Draw_Window.cxx: In function 'void Run_Appli(HWND)':
\occt_mingw64\src\Draw\Draw_Window.cxx:2394:53: warning: cast between incompatible function types from 'DWORD (*)()' {aka 'long unsigned int (*)()'} to 'LPTHREAD_START_ROUTINE' {aka 'long unsigned int (*)(void*)'} [-Wcast-function-type]
                            (LPTHREAD_START_ROUTINE) readStdinThreadFunc, // thread function
                                                     ^~~~~~~~~~~~~~~~~~~
\occt_mingw64\src\OpenGl\OpenGl_Window.cxx: In constructor 'OpenGl_Window::OpenGl_Window(const opencascade::handle<OpenGl_GraphicDriver>&, const opencascade::handle<Aspect_Window>&, Aspect_RenderingContext, const opencascade::handle<OpenGl_Caps>&, const opencascade::handle<OpenGl_Context>&)':
\occt_mingw64\src\OpenGl\OpenGl_Window.cxx:341:129: warning: cast between incompatible function types from 'PROC' {aka 'long long int (*)()'} to 'wglGetExtensionsStringARB_t' {aka 'const char* (*)(HDC__*)'} [-Wcast-function-type]
       wglGetExtensionsStringARB_t aGetExtensions = (wglGetExtensionsStringARB_t  )wglGetProcAddress ("wglGetExtensionsStringARB");
                                                                                                                                 ^
\occt_mingw64\src\OpenGl\OpenGl_Window.cxx:345:101: warning: cast between incompatible function types from 'PROC' {aka 'long long int (*)()'} to 'wglChoosePixelFormatARB_t' {aka 'int (*)(HDC__*, const int*, const float*, unsigned int, int*, unsigned int*)'} [-Wcast-function-type]
         aChoosePixProc = (wglChoosePixelFormatARB_t    )wglGetProcAddress ("wglChoosePixelFormatARB");
                                                                                                     ^
\occt_mingw64\src\OpenGl\OpenGl_Window.cxx:349:104: warning: cast between incompatible function types from 'PROC' {aka 'long long int (*)()'} to 'wglCreateContextAttribsARB_t' {aka 'HGLRC__* (*)(HDC__*, HGLRC__*, const int*)'} [-Wcast-function-type]
         aCreateCtxProc = (wglCreateContextAttribsARB_t )wglGetProcAddress ("wglCreateContextAttribsARB");
                                                                                                        ^
\occt_mingw64\src\D3DHost\D3DHost_View.cxx: In member function 'bool D3DHost_View::d3dInitLib()':
\occt_mingw64\src\D3DHost\D3DHost_View.cxx:146:114: warning: cast between incompatible function types from 'FARPROC' {aka 'long long int (*)()'} to 'Direct3DCreate9Ex_t' {aka 'long int (*)(unsigned int, IDirect3D9Ex**)'} [-Wcast-function-type]
       Direct3DCreate9Ex_t Direct3DCreate9ExProc = (Direct3DCreate9Ex_t )GetProcAddress (aLib, "Direct3DCreate9Ex");
                                                                                                                  ^
\occt_mingw64\src\BiTgte\BiTgte_Blend.cxx: In member function 'BiTgte_ContactType BiTgte_Blend::ContactType(Standard_Integer) const':
\occt_mingw64\src\BiTgte\BiTgte_Blend.cxx:1198:5: warning: this statement may fall through [-Wimplicit-fallthrough=]
     switch (Type2) {
     ^~~~~~
\occt_mingw64\src\BiTgte\BiTgte_Blend.cxx:1206:3: note: here
   case TopAbs_EDGE:
   ^~~~
\occt_mingw64\src\BiTgte\BiTgte_Blend.cxx:1207:5: warning: this statement may fall through [-Wimplicit-fallthrough=]
     switch (Type2) {
     ^~~~~~
\occt_mingw64\src\BiTgte\BiTgte_Blend.cxx:1214:3: note: here
   case TopAbs_FACE:
   ^~~~
\occt_mingw64\src\SWDRAW\SWDRAW_ShapeAnalysis.cxx: In function 'Standard_Integer MyVISEDG(Draw_Interpretor&, Standard_Integer, const char**)':
\occt_mingw64\src\SWDRAW\SWDRAW_ShapeAnalysis.cxx:865:11: warning: 'char* strncat(char*, const char*, size_t)' output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
    strncat(name,num,strlen(num));
    ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
\occt_mingw64\src\SWDRAW\SWDRAW_ShapeAnalysis.cxx:880:11: warning: 'char* strncat(char*, const char*, size_t)' output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
    strncat(name,num,strlen(num));
    ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
Building time: 00:21:24 

Steps to reproduce

Compile OCCT with the g++ version 8.1.0 and redirect standard error to some file.

Public activity

52 archived notes

Participants are labeled by their role within this record.

01Commenter 4
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: tiv
Date: Wed Sep 25 16:32:34 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.
02Commenter 4
Branch [archived branch] has been updated by Author.

[revision removed]


Detailed log of new commits:

Author: tiv
Date: Thu Sep 26 17:24:23 2019 +0300

    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".

03Commenter 4
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

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".
04Commenter 4
Patch is ready for review: http://vm-jenkins-test-12.nnov.opencascade.com:8080/view/CR30609-master-TIV/view/ALL/

Main OCCT branch: CR30609
OCCT branch with squashed commits: CR30609_1
05Commenter 5
The patch contains excessive changes, for instance, it defines 11 new preprocessor macros OCCT_COMPILER*, only one of which is used (in the same file!). Please avoid redundant and unnecessary things.
06Commenter 2
Please take into account Andrey remarks.
07Commenter 4
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
08Commenter 4
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
09Commenter 4
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
10Commenter 4
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
11Commenter 11
Patch is ready for review: http://vm-jenkins-test-12.nnov.opencascade.com:8080/view/CR30609-master-TIV/view/ALL/

Main OCCT branch: CR30609
OCCT branch with squashed commits: CR30609_1

Attention: both branches have been forcibly updated.

12Commenter 2
+      std::ostringstream aNameStream;
+      aNameStream << 'w' << iwire;
+      const std::string aName = aNameStream.str();
+      DBRep::Set (aName.c_str(), S.Value());

Please replace with TCollection_AsciiString.

author	tiv <[email removed]>	
Warnings issued by gcc 8.1.0 are eliminated.

Please correct commit description.
13Commenter 4
Branch [archived branch] has been updated by Author.

[revision removed]


Detailed log of new commits:

Author: tiv
Date: Wed Oct 16 20:45:45 2019 +0300

14Commenter 4
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
15Commenter 4
Branch [archived branch] has been created by Participant.

[revision removed]


Detailed log of new commits:

Author: tiv
Date: Wed Oct 16 20:47:30 2019 +0300

    0030609: Coding - eliminate warnings issued by gcc 8.1.0
    
    Warnings issued by gcc 8.1.0 are eliminated.
    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" (introduced in gcc 8.1.0).
16Commenter 16
I have removed the function MyVISEDG in SWDRAW_ShapeAnalysis.cxx as it does not seem to do anything useful and relevant DRAW command is never used in tests. Please review branch CR30609_2.
17Commenter 1
18Commenter 4
Branch [archived branch] has been updated by Author.

[revision removed]


Detailed log of new commits:

Author: tiv
Date: Mon Oct 21 09:08:44 2019 +0300

    # The default template parameter AToFunction of the function template OSD_FunctionCast which caused compilation errors on some old compilers is removed.

19Commenter 4
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
20Commenter 20
Compilation errors are fixed.

Patch is ready for review: http://vm-jenkins-test-12.nnov.opencascade.com:8080/view/CR30609-master-TIV/view/ALL/

Main OCCT branch: CR30609
OCCT branch with squashed commits: CR30609_1

Attention: branch CR30609_1 has been forcibly updated.
21Commenter 1
Windows-32-vc9/Windows-32-vc10/Windows-32-vc11:

1>c:\builds\IR-2019-10-20_IR-2019-10-20\Windows-32-VC10-opt\OCCT\src\OSD\OSD_SharedLibrary.cxx(269) : error C2893: Failed to specialize function template 'opencascade::std::enable_if<std::tr1::is_function<opencascade::std::remove_pointer<_Ty>::type>::value&&std::tr1::is_function<TheFromFunction>::value,opencascade::std::remove_pointer<_Ty>::type*>::type OSD_FunctionCast(TheFromFunction *const )'

1>c:\builds\IR-2019-10-20_IR-2019-10-20\Windows-32-VC10-opt\OCCT\src\OSD\OSD_Parallel.cxx(47) : error C2893: Failed to specialize function template 'opencascade::std::enable_if<std::tr1::is_function<opencascade::std::remove_pointer<_Ty>::type>::value&&std::tr1::is_function<TheFromFunction>::value,opencascade::std::remove_pointer<_Ty>::type*>::type OSD_FunctionCast(TheFromFunction *const )'

Windows-64-vc11:
39>C:\builds\IR-2019-10-20_IR-2019-10-20\Windows-64-VC11-opt\OCCT\src\OpenGl\OpenGl_Window.cxx(355) : error C2893: Failed to specialize function template 'opencascade::std::enable_if<std::is_function<opencascade::std::remove_pointer<_Ty>::type>::value&&std::is_function<TheFromFunction>::value,opencascade::std::remove_pointer<_Ty>::type*>::type OSD_FunctionCast(TheFromFunction *const )'

22Commenter 4
Branch [archived branch] has been updated by Author.

[revision removed]


Detailed log of new commits:

Author: tiv
Date: Tue Oct 22 13:40:22 2019 +0300

    # Fix for compilation errors on Win32-platform in Visual Studio older than Visual Studio 2013.

23Commenter 4
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
24Commenter 4
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
25Commenter 4
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
26Commenter 4
Branch [archived branch] has been updated by Author.

[revision removed]


Detailed log of new commits:

Author: tiv
Date: Tue Oct 22 15:21:30 2019 +0300

    # The function MyVISEDG in SWDRAW_ShapeAnalysis.cxx is removed as it does not seem to do anything useful and relevant DRAW command is never used in tests (according to abv).

27Commenter 4
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: Commenter 3
Date: Thu Sep 26 17:20:26 2019 +0300

    0030609: Coding - eliminate warnings issued by gcc 8.1.0
    
    Warnings issued by gcc 8.1.0 are eliminated.
    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" (introduced in gcc 8.1.0).
    The function MyVISEDG in SWDRAW_ShapeAnalysis.cxx is removed as it does not seem to do anything useful and relevant DRAW command is never used in tests.
28Commenter 4
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
29Commenter 29
Branch CR30609_3 is rebased on new master
30Commenter 4
Branch [archived branch] has been updated by Participant.

[revision removed]


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 Author in TKernel

31Commenter 4
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
32Commenter 4
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: tiv
Date: Wed Oct 23 10:34:15 2019 +0300

    0030609: Coding - eliminate warnings issued by gcc 8.1.0
    
    Warnings issued by gcc 8.1.0 are eliminated.
    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" (introduced in gcc 8.1.0).
    The function MyVISEDG in SWDRAW_ShapeAnalysis.cxx is removed as it does not seem to do anything useful and relevant DRAW command K_VISEDG is never used in tests.
33Commenter 33
Compilation errors are fixed.
Removal of MyVISEDG function proposed by abv is included in the main issue branch (CR30609).

Patch is ready for review: http://vm-jenkins-test-12.nnov.opencascade.com:8080/view/CR30609-master-TIV/view/ALL/

Main OCCT branch: CR30609
OCCT branch with squashed commits: CR30609_4

Attention: branch CR30609 has been forcibly updated.
34Commenter 1
Windows-32-VC9-opt/Windows-32-VC10-opt/Windows-32-VC11-opt:

1>c:\builds\IR-2019-10-25_IR-2019-10-25\Windows-32-VC10-opt\OCCT\src\OSD\OSD_Parallel.cxx(47) : error C2770: invalid explicit template argument(s) for 'opencascade::std::enable_if<std::tr1::is_function<opencascade::std::remove_pointer<_Ty>::type>::value,opencascade::std::remove_pointer<_Ty>::type*>::type OSD_FunctionCast(TheFromFunction *const )'

1>c:\builds\IR-2019-10-25_IR-2019-10-25\Windows-32-VC10-opt\OCCT\src\OSD\OSD_Parallel.cxx(226) : error C2770: invalid explicit template argument(s) for 'opencascade::std::enable_if<std::tr1::is_function<opencascade::std::remove_pointer<_Ty>::type>::value,opencascade::std::remove_pointer<_Ty>::type*>::type OSD_FunctionCast(TheFromFunction *const )'


Windows-64-VC11-opt:

36>C:\builds\IR-2019-10-25_IR-2019-10-25\Windows-64-VC11-opt\OCCT\src\OpenGl\OpenGl_Window.cxx(355) : error C2893: Failed to specialize function template 'opencascade::std::enable_if<std::is_function<opencascade::std::remove_pointer<_Ty>::type>::value&&std::is_function<TheFromFunction>::value,opencascade::std::remove_pointer<_Ty>::type*>::type OSD_FunctionCast(TheFromFunction *const )'
35Commenter 4
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: tiv
Date: Fri Oct 25 16:01:09 2019 +0300

    0030609: Coding - eliminate warnings issued by gcc 8.1.0
    
    Warnings issued by gcc 8.1.0 are eliminated.
    New Standard_FunctionCastWarningDisable.hxx header file is introduced to disable GCC warning "-Wcast-function-type" in those files *.cxx where it is issued. This warning is issued when the conversion from the pointer to one function type to the pointer to another function type takes places, it was added in gcc 8.1.0.
    The function MyVISEDG in SWDRAW_ShapeAnalysis.cxx is removed as it does not seem to do anything useful and relevant DRAW command K_VISEDG is never used in tests.
36Commenter 4
Branch [archived branch] has been updated by Author.

[revision removed]


Detailed log of new commits:

Author: tiv
Date: Tue Oct 22 15:21:30 2019 +0300

    # Function OSD_FunctionCast is removed due to compilation errors on MSVC 2008, 2010, and 2012 for Win32 platform.
    # New Standard_FunctionCastWarningDisable.hxx header file is introduced to disable GCC warning "-Wcast-function-type".

37Commenter 37
Patch is ready for review (only compilation was tested on Jenkins): http://jenkins-test-12.nnov.opencascade.com:8080/view/CR30609-master-TIV/view/OCCT%20compile/

Main OCCT branch: CR30609
OCCT branch with squashed commits: CR30609_5
38Commenter 2
+#include <Standard_FunctionCastWarningDisable.hxx>

It would be more convenient to call it Standard_WarningDisableFunctionCast.hxx to be closer to similar header Standard_WarningsDisable.hxx.
39Commenter 2
+// GCC diagnostic -Wcast-function-type introduced in GCC 8.1 is disabled.
+// This diagnostic warns when a function pointer is cast to an incompatible function pointer

Description is incomplete - the reason for disabling a warning should be specified:
> Standard APIs loading function pointer from library (like dlsym() or wglGetProcAddress()) have no meaning to return function of specified type nor to verify that exported symbol actually matches expected function signature, so that unsafe function cast is the only way.
> As there is no way to fix this issue at OCCT level (until safer APIs being introduced), suppressing this warning is the only reasonable way.
> As this warning can point out broken places, it should be suppressed only locally, where usage of unsafe function cast has been verified.
40Commenter 4
Branch [archived branch] has been updated by Author.

[revision removed]


Detailed log of new commits:

Author: tiv
Date: Mon Oct 28 09:37:04 2019 +0300

    # kgv remarks are taken into account.

41Commenter 4
Branch [archived branch] has been updated by Author.

[revision removed]


Detailed log of new commits:

Author: tiv
Date: Mon Oct 28 10:27:17 2019 +0300

    ~

42Commenter 4
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
43Commenter 4
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
44Commenter 4
Branch [archived branch] has been updated forcibly by Participant.

[revision removed]
45Commenter 45
I have force-pushed minor correction in CR30609_5; the change is within comment in Standard_WarningDisableFunctionCast.hxx, for Doxygen to recognize this comment as documentation of the file
46Commenter 46
Reviewed, please integrate (compilations needs to be checked on all platforms)
47Commenter 4
Branch [archived branch] has been deleted by Participant.

[revision removed]
48Commenter 4
Branch [archived branch] has been deleted by Participant.

[revision removed]
49Commenter 4
Branch [archived branch] has been deleted by Participant.

[revision removed]
50Commenter 4
Branch [archived branch] has been deleted by Participant.

[revision removed]
51Commenter 4
Branch [archived branch] has been deleted by Participant.

[revision removed]
52Commenter 4
Branch [archived branch] has been deleted by Participant.

[revision removed]

Related records