Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
master
-
None
-
gcc 8.2, Linux 64bit
Description
Compiler shows warning about wrong function cast.
Function pointer with signature
void* &(*)()
|
casted into function pointer with signature
void* (*)()
|
I propose just support both signature independent in TGlobalMappedFunction - with very small overhead.
I can provide PR for it.
Compiler output:
/home/linev/git/webgui/core/base/src/TROOT.cxx: In member function ‘TCollection* TROOT::GetListOfGlobals(Bool_t)’:
|
/home/linev/git/webgui/core/base/src/TROOT.cxx:1769:96: warning: cast between incompatible function types from ‘TVirtualPad*& (*)()’ to ‘TGlobalMappedFunction::GlobalFunc_t’ {aka ‘void* (*)()’} [-Wcast-function-type]
|
(TGlobalMappedFunction::GlobalFunc_t)&TVirtualPad::Pad));
|
^~~
|
/home/linev/git/webgui/core/base/src/TROOT.cxx:1773:94: warning: cast between incompatible function types from ‘TVirtualX*& (*)()’ to ‘TGlobalMappedFunction::GlobalFunc_t’ {aka ‘void* (*)()’} [-Wcast-function-type]
|
(TGlobalMappedFunction::GlobalFunc_t)&TVirtualX::Instance));
|
^~~~~~~~
|
/home/linev/git/webgui/core/base/src/TROOT.cxx:1775:95: warning: cast between incompatible function types from ‘TDirectory*& (*)()’ to ‘TGlobalMappedFunction::GlobalFunc_t’ {aka ‘void* (*)()’} [-Wcast-function-type]
|
(TGlobalMappedFunction::GlobalFunc_t)&TDirectory::CurrentDirectory));
|
^~~~~~~~~~~~~~~~
|