Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: redefine overloaded virtual methods in derived class #625

Merged
merged 1 commit into from
Nov 7, 2023

Conversation

plexoos
Copy link
Member

@plexoos plexoos commented Nov 3, 2023

Compiler errors due to hidden virtual method appear when building the
code against ROOT6.24

g++ -m64 -fPIC -pipe -Wall -Woverloaded-virtual -std=c++0x -Wno-long-long -pthread -Werror -O2 -g -falign-loops -falign-jumps -falign-functions -Dsl79_gcc485 -D__ROOT__ -DNEW_DAQ_READER -I. -IStRoot -I.sl79_gcc485/include -I/star/ROOT/6.24.06/geant3/TGeant3 -I/opt/software/linux-scientific7-x86_64/gcc-4.8.5/root-6.24.06-gbmdgvxscayjf6nqc5tatcs424pan4gs/include -c .sl79_gcc485/OBJ/StarVMC/StVMCMaker/StVMCMaker.cxx -o .sl79_gcc485/OBJ/StarVMC/StVMCMaker/StVMCMaker.o
In file included from .sl79_gcc485/include/StarVMCApplication.h:10:0,
                 from .sl79_gcc485/OBJ/StarVMC/StVMCMaker/StVMCMaker.h:21,
                 from .sl79_gcc485/OBJ/StarVMC/StVMCMaker/StVMCMaker.cxx:98:
/opt/software/linux-scientific7-x86_64/gcc-4.8.5/root-6.24.06-gbmdgvxscayjf6nqc5tatcs424pan4gs/include/TVirtualMC.h:804:17: error: 'virtual void TVirtualMC::ProcessEvent(Int_t)' was hidden [-Werror=overloaded-virtual]
    virtual void ProcessEvent(Int_t eventId);
                 ^
In file included from .sl79_gcc485/include/TGeant3TGeo.h:12:0,
                 from .sl79_gcc485/OBJ/StarVMC/StVMCMaker/StVMCMaker.h:22,
                 from .sl79_gcc485/OBJ/StarVMC/StVMCMaker/StVMCMaker.cxx:98:
.sl79_gcc485/include/TGeant3.h:1061:16: error:   by 'virtual void TGeant3::ProcessEvent()' [-Werror=overloaded-virtual]
   virtual void ProcessEvent();
                ^
In file included from .sl79_gcc485/include/StarVMCApplication.h:10:0,
                 from .sl79_gcc485/OBJ/StarVMC/StVMCMaker/StVMCMaker.h:21,
                 from .sl79_gcc485/OBJ/StarVMC/StVMCMaker/StVMCMaker.cxx:98:
/opt/software/linux-scientific7-x86_64/gcc-4.8.5/root-6.24.06-gbmdgvxscayjf6nqc5tatcs424pan4gs/include/TVirtualMC.h:882:17: error: 'virtual void TVirtualMC::ProcessEvent(Int_t, Bool_t)' was hidden [-Werror=overloaded-virtual]
    virtual void ProcessEvent(Int_t eventId, Bool_t isInterruptible);
                 ^
In file included from .sl79_gcc485/include/TGeant3TGeo.h:12:0,
                 from .sl79_gcc485/OBJ/StarVMC/StVMCMaker/StVMCMaker.h:22,
                 from .sl79_gcc485/OBJ/StarVMC/StVMCMaker/StVMCMaker.cxx:98:
.sl79_gcc485/include/TGeant3.h:1061:16: error:   by 'virtual void TGeant3::ProcessEvent()' [-Werror=overloaded-virtual]
   virtual void ProcessEvent();
                ^

See #619 for details

Compiler errors due to hidden virtual method appear when building the
code against ROOT6.24

```
g++ -m64 -fPIC -pipe -Wall -Woverloaded-virtual -std=c++0x -Wno-long-long -pthread -Werror -O2 -g -falign-loops -falign-jumps -falign-functions -Dsl79_gcc485 -D__ROOT__ -DNEW_DAQ_READER -I. -IStRoot -I.sl79_gcc485/include -I/star/ROOT/6.24.06/geant3/TGeant3 -I/opt/software/linux-scientific7-x86_64/gcc-4.8.5/root-6.24.06-gbmdgvxscayjf6nqc5tatcs424pan4gs/include -c .sl79_gcc485/OBJ/StarVMC/StVMCMaker/StVMCMaker.cxx -o .sl79_gcc485/OBJ/StarVMC/StVMCMaker/StVMCMaker.o
In file included from .sl79_gcc485/include/StarVMCApplication.h:10:0,
                 from .sl79_gcc485/OBJ/StarVMC/StVMCMaker/StVMCMaker.h:21,
                 from .sl79_gcc485/OBJ/StarVMC/StVMCMaker/StVMCMaker.cxx:98:
/opt/software/linux-scientific7-x86_64/gcc-4.8.5/root-6.24.06-gbmdgvxscayjf6nqc5tatcs424pan4gs/include/TVirtualMC.h:804:17: error: 'virtual void TVirtualMC::ProcessEvent(Int_t)' was hidden [-Werror=overloaded-virtual]
    virtual void ProcessEvent(Int_t eventId);
                 ^
In file included from .sl79_gcc485/include/TGeant3TGeo.h:12:0,
                 from .sl79_gcc485/OBJ/StarVMC/StVMCMaker/StVMCMaker.h:22,
                 from .sl79_gcc485/OBJ/StarVMC/StVMCMaker/StVMCMaker.cxx:98:
.sl79_gcc485/include/TGeant3.h:1061:16: error:   by 'virtual void TGeant3::ProcessEvent()' [-Werror=overloaded-virtual]
   virtual void ProcessEvent();
                ^
In file included from .sl79_gcc485/include/StarVMCApplication.h:10:0,
                 from .sl79_gcc485/OBJ/StarVMC/StVMCMaker/StVMCMaker.h:21,
                 from .sl79_gcc485/OBJ/StarVMC/StVMCMaker/StVMCMaker.cxx:98:
/opt/software/linux-scientific7-x86_64/gcc-4.8.5/root-6.24.06-gbmdgvxscayjf6nqc5tatcs424pan4gs/include/TVirtualMC.h:882:17: error: 'virtual void TVirtualMC::ProcessEvent(Int_t, Bool_t)' was hidden [-Werror=overloaded-virtual]
    virtual void ProcessEvent(Int_t eventId, Bool_t isInterruptible);
                 ^
In file included from .sl79_gcc485/include/TGeant3TGeo.h:12:0,
                 from .sl79_gcc485/OBJ/StarVMC/StVMCMaker/StVMCMaker.h:22,
                 from .sl79_gcc485/OBJ/StarVMC/StVMCMaker/StVMCMaker.cxx:98:
.sl79_gcc485/include/TGeant3.h:1061:16: error:   by 'virtual void TGeant3::ProcessEvent()' [-Werror=overloaded-virtual]
   virtual void ProcessEvent();
                ^
```
Copy link
Member

@iraklic iraklic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never mind, looked at something else.

Copy link
Contributor

@klendathu2k klendathu2k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@klendathu2k klendathu2k merged commit 43def14 into star-bnl:main Nov 7, 2023
148 checks passed
@plexoos plexoos deleted the fix_virtual_overloads branch November 7, 2023 17:23
dkapukchyan pushed a commit to dkapukchyan/star-sw that referenced this pull request Mar 11, 2024
Compiler errors due to hidden virtual method appear when building the
code against ROOT6.24

```
g++ -m64 -fPIC -pipe -Wall -Woverloaded-virtual -std=c++0x -Wno-long-long -pthread -Werror -O2 -g -falign-loops -falign-jumps -falign-functions -Dsl79_gcc485 -D__ROOT__ -DNEW_DAQ_READER -I. -IStRoot -I.sl79_gcc485/include -I/star/ROOT/6.24.06/geant3/TGeant3 -I/opt/software/linux-scientific7-x86_64/gcc-4.8.5/root-6.24.06-gbmdgvxscayjf6nqc5tatcs424pan4gs/include -c .sl79_gcc485/OBJ/StarVMC/StVMCMaker/StVMCMaker.cxx -o .sl79_gcc485/OBJ/StarVMC/StVMCMaker/StVMCMaker.o
In file included from .sl79_gcc485/include/StarVMCApplication.h:10:0,
                 from .sl79_gcc485/OBJ/StarVMC/StVMCMaker/StVMCMaker.h:21,
                 from .sl79_gcc485/OBJ/StarVMC/StVMCMaker/StVMCMaker.cxx:98:
/opt/software/linux-scientific7-x86_64/gcc-4.8.5/root-6.24.06-gbmdgvxscayjf6nqc5tatcs424pan4gs/include/TVirtualMC.h:804:17: error: 'virtual void TVirtualMC::ProcessEvent(Int_t)' was hidden [-Werror=overloaded-virtual]
    virtual void ProcessEvent(Int_t eventId);
                 ^
In file included from .sl79_gcc485/include/TGeant3TGeo.h:12:0,
                 from .sl79_gcc485/OBJ/StarVMC/StVMCMaker/StVMCMaker.h:22,
                 from .sl79_gcc485/OBJ/StarVMC/StVMCMaker/StVMCMaker.cxx:98:
.sl79_gcc485/include/TGeant3.h:1061:16: error:   by 'virtual void TGeant3::ProcessEvent()' [-Werror=overloaded-virtual]
   virtual void ProcessEvent();
                ^
In file included from .sl79_gcc485/include/StarVMCApplication.h:10:0,
                 from .sl79_gcc485/OBJ/StarVMC/StVMCMaker/StVMCMaker.h:21,
                 from .sl79_gcc485/OBJ/StarVMC/StVMCMaker/StVMCMaker.cxx:98:
/opt/software/linux-scientific7-x86_64/gcc-4.8.5/root-6.24.06-gbmdgvxscayjf6nqc5tatcs424pan4gs/include/TVirtualMC.h:882:17: error: 'virtual void TVirtualMC::ProcessEvent(Int_t, Bool_t)' was hidden [-Werror=overloaded-virtual]
    virtual void ProcessEvent(Int_t eventId, Bool_t isInterruptible);
                 ^
In file included from .sl79_gcc485/include/TGeant3TGeo.h:12:0,
                 from .sl79_gcc485/OBJ/StarVMC/StVMCMaker/StVMCMaker.h:22,
                 from .sl79_gcc485/OBJ/StarVMC/StVMCMaker/StVMCMaker.cxx:98:
.sl79_gcc485/include/TGeant3.h:1061:16: error:   by 'virtual void TGeant3::ProcessEvent()' [-Werror=overloaded-virtual]
   virtual void ProcessEvent();
                ^
```

See star-bnl#619 for details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants