Silence warning messages during a GEANT4 project compilation

Hello, I have a GEANT4 project that links to ROOT libraries to create some histos and trees. Everything works fine but during the compilation, I get a lot of warning message such as

In file included from /opt/root6/include/root/TObject.h:238:0,
                 from /opt/root6/include/root/TNamed.h:26,
                 from /opt/root6/include/root/TDirectory.h:25,
                 from /opt/root6/include/root/TROOT.h:29,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250AnalysisManager.hh:6,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:39:
/opt/root6/include/root/TBuffer.h: In function ‘TBuffer& operator>>(TBuffer&, Short_t&)’:
/opt/root6/include/root/TBuffer.h:333:52: attention : declaration of ‘s’ shadows a global declaration [-Wshadow]
 inline TBuffer &operator>>(TBuffer &buf, Short_t &s)  { buf.ReadShort(s);  return buf; }
                                                    ^
In file included from /opt/geant4/include/Geant4/CLHEP/Units/PhysicalConstants.h:42:0,
                 from /opt/geant4/include/Geant4/G4ParticleDefinition.hh:58,
                 from /opt/geant4/include/Geant4/G4ParticleGun.hh:37,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250PrimaryGeneratorAction.hh:35,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:32:
/opt/geant4/include/Geant4/CLHEP/Units/SystemOfUnits.h:148:24: note: shadowed declaration is here
   static const double  s = second;
                        ^
In file included from /opt/root6/include/root/TObject.h:238:0,
                 from /opt/root6/include/root/TNamed.h:26,
                 from /opt/root6/include/root/TDirectory.h:25,
                 from /opt/root6/include/root/TROOT.h:29,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250AnalysisManager.hh:6,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:39:
/opt/root6/include/root/TBuffer.h: In function ‘TBuffer& operator>>(TBuffer&, UShort_t&)’:
/opt/root6/include/root/TBuffer.h:334:53: attention : declaration of ‘s’ shadows a global declaration [-Wshadow]
 inline TBuffer &operator>>(TBuffer &buf, UShort_t &s) { buf.ReadUShort(s); return buf; }
                                                     ^
In file included from /opt/geant4/include/Geant4/CLHEP/Units/PhysicalConstants.h:42:0,
                 from /opt/geant4/include/Geant4/G4ParticleDefinition.hh:58,
                 from /opt/geant4/include/Geant4/G4ParticleGun.hh:37,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250PrimaryGeneratorAction.hh:35,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:32:
/opt/geant4/include/Geant4/CLHEP/Units/SystemOfUnits.h:148:24: note: shadowed declaration is here
   static const double  s = second;
                        ^
In file included from /opt/root6/include/root/TObject.h:238:0,
                 from /opt/root6/include/root/TNamed.h:26,
                 from /opt/root6/include/root/TDirectory.h:25,
                 from /opt/root6/include/root/TROOT.h:29,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250AnalysisManager.hh:6,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:39:
/opt/root6/include/root/TBuffer.h: In function ‘TBuffer& operator>>(TBuffer&, TString&)’:
/opt/root6/include/root/TBuffer.h:344:52: attention : declaration of ‘s’ shadows a global declaration [-Wshadow]
 inline TBuffer &operator>>(TBuffer &buf, TString &s)  { buf.ReadTString(s);return buf; }
                                                    ^
In file included from /opt/geant4/include/Geant4/CLHEP/Units/PhysicalConstants.h:42:0,
                 from /opt/geant4/include/Geant4/G4ParticleDefinition.hh:58,
                 from /opt/geant4/include/Geant4/G4ParticleGun.hh:37,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250PrimaryGeneratorAction.hh:35,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:32:
/opt/geant4/include/Geant4/CLHEP/Units/SystemOfUnits.h:148:24: note: shadowed declaration is here
   static const double  s = second;
                        ^
In file included from /opt/root6/include/root/TObject.h:238:0,
                 from /opt/root6/include/root/TNamed.h:26,
                 from /opt/root6/include/root/TDirectory.h:25,
                 from /opt/root6/include/root/TROOT.h:29,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250AnalysisManager.hh:6,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:39:
/opt/root6/include/root/TBuffer.h: In function ‘TBuffer& operator<<(TBuffer&, Short_t)’:
/opt/root6/include/root/TBuffer.h:349:51: attention : declaration of ‘s’ shadows a global declaration [-Wshadow]
 inline TBuffer &operator<<(TBuffer &buf, Short_t s)  { buf.WriteShort(s);  return buf; }
                                                   ^
In file included from /opt/geant4/include/Geant4/CLHEP/Units/PhysicalConstants.h:42:0,
                 from /opt/geant4/include/Geant4/G4ParticleDefinition.hh:58,
                 from /opt/geant4/include/Geant4/G4ParticleGun.hh:37,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250PrimaryGeneratorAction.hh:35,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:32:
/opt/geant4/include/Geant4/CLHEP/Units/SystemOfUnits.h:148:24: note: shadowed declaration is here
   static const double  s = second;
                        ^
In file included from /opt/root6/include/root/TObject.h:238:0,
                 from /opt/root6/include/root/TNamed.h:26,
                 from /opt/root6/include/root/TDirectory.h:25,
                 from /opt/root6/include/root/TROOT.h:29,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250AnalysisManager.hh:6,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:39:
/opt/root6/include/root/TBuffer.h: In function ‘TBuffer& operator<<(TBuffer&, UShort_t)’:
/opt/root6/include/root/TBuffer.h:350:52: attention : declaration of ‘s’ shadows a global declaration [-Wshadow]
 inline TBuffer &operator<<(TBuffer &buf, UShort_t s) { buf.WriteUShort(s); return buf; }
                                                    ^
In file included from /opt/geant4/include/Geant4/CLHEP/Units/PhysicalConstants.h:42:0,
                 from /opt/geant4/include/Geant4/G4ParticleDefinition.hh:58,
                 from /opt/geant4/include/Geant4/G4ParticleGun.hh:37,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250PrimaryGeneratorAction.hh:35,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:32:
/opt/geant4/include/Geant4/CLHEP/Units/SystemOfUnits.h:148:24: note: shadowed declaration is here
   static const double  s = second;
                        ^
In file included from /opt/root6/include/root/TObject.h:238:0,
                 from /opt/root6/include/root/TNamed.h:26,
                 from /opt/root6/include/root/TDirectory.h:25,
                 from /opt/root6/include/root/TROOT.h:29,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250AnalysisManager.hh:6,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:39:
/opt/root6/include/root/TBuffer.h: In function ‘TBuffer& operator<<(TBuffer&, const TString&)’:
/opt/root6/include/root/TBuffer.h:360:58: attention : declaration of ‘s’ shadows a global declaration [-Wshadow]
 inline TBuffer &operator<<(TBuffer &buf, const TString &s) { buf.WriteTString(s);return buf; }
                                                          ^
In file included from /opt/geant4/include/Geant4/CLHEP/Units/PhysicalConstants.h:42:0,
                 from /opt/geant4/include/Geant4/G4ParticleDefinition.hh:58,
                 from /opt/geant4/include/Geant4/G4ParticleGun.hh:37,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250PrimaryGeneratorAction.hh:35,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:32:
/opt/geant4/include/Geant4/CLHEP/Units/SystemOfUnits.h:148:24: note: shadowed declaration is here
   static const double  s = second;
                        ^
In file included from /opt/root6/include/root/TNamed.h:29:0,
                 from /opt/root6/include/root/TDirectory.h:25,
                 from /opt/root6/include/root/TROOT.h:29,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250AnalysisManager.hh:6,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:39:
/opt/root6/include/root/TString.h: In copy constructor ‘TSubString::TSubString(const TSubString&)’:
/opt/root6/include/root/TString.h:106:6: attention : declaration of ‘s’ shadows a global declaration [-Wshadow]
      : fStr(s.fStr), fBegin(s.fBegin), fExtent(s.fExtent) { }
      ^
In file included from /opt/geant4/include/Geant4/CLHEP/Units/PhysicalConstants.h:42:0,
                 from /opt/geant4/include/Geant4/G4ParticleDefinition.hh:58,
                 from /opt/geant4/include/Geant4/G4ParticleGun.hh:37,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250PrimaryGeneratorAction.hh:35,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:32:
/opt/geant4/include/Geant4/CLHEP/Units/SystemOfUnits.h:148:24: note: shadowed declaration is here
   static const double  s = second;
                        ^
In file included from /opt/root6/include/root/TNamed.h:29:0,
                 from /opt/root6/include/root/TDirectory.h:25,
                 from /opt/root6/include/root/TROOT.h:29,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250AnalysisManager.hh:6,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:39:
/opt/root6/include/root/TString.h: In static member function ‘static Ssiz_t TString::Align(Ssiz_t)’:
/opt/root6/include/root/TString.h:213:35: attention : declaration of ‘s’ shadows a global declaration [-Wshadow]
    static Ssiz_t  Align(Ssiz_t s) { return (s + (kAlignment-1)) & ~(kAlignment-1); }
                                   ^
In file included from /opt/geant4/include/Geant4/CLHEP/Units/PhysicalConstants.h:42:0,
                 from /opt/geant4/include/Geant4/G4ParticleDefinition.hh:58,
                 from /opt/geant4/include/Geant4/G4ParticleGun.hh:37,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250PrimaryGeneratorAction.hh:35,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:32:
/opt/geant4/include/Geant4/CLHEP/Units/SystemOfUnits.h:148:24: note: shadowed declaration is here
   static const double  s = second;
                        ^
In file included from /opt/root6/include/root/TNamed.h:29:0,
                 from /opt/root6/include/root/TDirectory.h:25,
                 from /opt/root6/include/root/TROOT.h:29,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250AnalysisManager.hh:6,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:39:
/opt/root6/include/root/TString.h: In static member function ‘static Ssiz_t TString::Recommend(Ssiz_t)’:
/opt/root6/include/root/TString.h:214:39: attention : declaration of ‘s’ shadows a global declaration [-Wshadow]
    static Ssiz_t  Recommend(Ssiz_t s) { return (s < kMinCap ? kMinCap : Align(s+1)) - 1; }
                                       ^
In file included from /opt/geant4/include/Geant4/CLHEP/Units/PhysicalConstants.h:42:0,
                 from /opt/geant4/include/Geant4/G4ParticleDefinition.hh:58,
                 from /opt/geant4/include/Geant4/G4ParticleGun.hh:37,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250PrimaryGeneratorAction.hh:35,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:32:
/opt/geant4/include/Geant4/CLHEP/Units/SystemOfUnits.h:148:24: note: shadowed declaration is here
   static const double  s = second;
                        ^
In file included from /opt/root6/include/root/TNamed.h:29:0,
                 from /opt/root6/include/root/TDirectory.h:25,
                 from /opt/root6/include/root/TROOT.h:29,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250AnalysisManager.hh:6,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:39:
/opt/root6/include/root/TString.h: In member function ‘void TString::SetShortSize(Ssiz_t)’:
/opt/root6/include/root/TString.h:220:42: attention : declaration of ‘s’ shadows a global declaration [-Wshadow]
    void           SetShortSize(Ssiz_t s) { fRep.fShort.fSize = (unsigned char)(s << 1); }
                                          ^
In file included from /opt/geant4/include/Geant4/CLHEP/Units/PhysicalConstants.h:42:0,
                 from /opt/geant4/include/Geant4/G4ParticleDefinition.hh:58,
                 from /opt/geant4/include/Geant4/G4ParticleGun.hh:37,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250PrimaryGeneratorAction.hh:35,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:32:
/opt/geant4/include/Geant4/CLHEP/Units/SystemOfUnits.h:148:24: note: shadowed declaration is here
   static const double  s = second;
                        ^
In file included from /opt/root6/include/root/TNamed.h:29:0,
                 from /opt/root6/include/root/TDirectory.h:25,
                 from /opt/root6/include/root/TROOT.h:29,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250AnalysisManager.hh:6,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:39:
/opt/root6/include/root/TString.h: In member function ‘void TString::SetLongSize(Ssiz_t)’:
/opt/root6/include/root/TString.h:226:41: attention : declaration of ‘s’ shadows a global declaration [-Wshadow]
    void           SetLongSize(Ssiz_t s) { fRep.fLong.fSize = s; }
                                         ^
In file included from /opt/geant4/include/Geant4/CLHEP/Units/PhysicalConstants.h:42:0,
                 from /opt/geant4/include/Geant4/G4ParticleDefinition.hh:58,
                 from /opt/geant4/include/Geant4/G4ParticleGun.hh:37,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250PrimaryGeneratorAction.hh:35,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:32:
/opt/geant4/include/Geant4/CLHEP/Units/SystemOfUnits.h:148:24: note: shadowed declaration is here
   static const double  s = second;
                        ^
In file included from /opt/root6/include/root/TNamed.h:29:0,
                 from /opt/root6/include/root/TDirectory.h:25,
                 from /opt/root6/include/root/TROOT.h:29,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250AnalysisManager.hh:6,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:39:
/opt/root6/include/root/TString.h: In member function ‘void TString::SetSize(Ssiz_t)’:
/opt/root6/include/root/TString.h:228:37: attention : declaration of ‘s’ shadows a global declaration [-Wshadow]
    void           SetSize(Ssiz_t s) { IsLong() ? SetLongSize(s) : SetShortSize(s); }
                                     ^
In file included from /opt/geant4/include/Geant4/CLHEP/Units/PhysicalConstants.h:42:0,
                 from /opt/geant4/include/Geant4/G4ParticleDefinition.hh:58,
                 from /opt/geant4/include/Geant4/G4ParticleGun.hh:37,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250PrimaryGeneratorAction.hh:35,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:32:
/opt/geant4/include/Geant4/CLHEP/Units/SystemOfUnits.h:148:24: note: shadowed declaration is here
   static const double  s = second;
                        ^
In file included from /opt/root6/include/root/TNamed.h:29:0,
                 from /opt/root6/include/root/TDirectory.h:25,
                 from /opt/root6/include/root/TROOT.h:29,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250AnalysisManager.hh:6,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:39:
/opt/root6/include/root/TString.h: In member function ‘void TString::SetLongCap(Ssiz_t)’:
/opt/root6/include/root/TString.h:229:40: attention : declaration of ‘s’ shadows a global declaration [-Wshadow]
    void           SetLongCap(Ssiz_t s) { fRep.fLong.fCap = kLongMask | s; }
                                        ^
In file included from /opt/geant4/include/Geant4/CLHEP/Units/PhysicalConstants.h:42:0,
                 from /opt/geant4/include/Geant4/G4ParticleDefinition.hh:58,
                 from /opt/geant4/include/Geant4/G4ParticleGun.hh:37,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250PrimaryGeneratorAction.hh:35,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:32:
/opt/geant4/include/Geant4/CLHEP/Units/SystemOfUnits.h:148:24: note: shadowed declaration is here
   static const double  s = second;
                        ^
In file included from /opt/root6/include/root/TNamed.h:29:0,
                 from /opt/root6/include/root/TDirectory.h:25,
                 from /opt/root6/include/root/TROOT.h:29,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250AnalysisManager.hh:6,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:39:
/opt/root6/include/root/TString.h: In function ‘UInt_t Hash(const TString&)’:
/opt/root6/include/root/TString.h:459:36: attention : declaration of ‘s’ shadows a global declaration [-Wshadow]
 inline UInt_t Hash(const TString &s) { return s.Hash(); }
                                    ^
In file included from /opt/geant4/include/Geant4/CLHEP/Units/PhysicalConstants.h:42:0,
                 from /opt/geant4/include/Geant4/G4ParticleDefinition.hh:58,
                 from /opt/geant4/include/Geant4/G4ParticleGun.hh:37,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250PrimaryGeneratorAction.hh:35,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:32:
/opt/geant4/include/Geant4/CLHEP/Units/SystemOfUnits.h:148:24: note: shadowed declaration is here
   static const double  s = second;
                        ^
In file included from /opt/root6/include/root/TNamed.h:29:0,
                 from /opt/root6/include/root/TDirectory.h:25,
                 from /opt/root6/include/root/TROOT.h:29,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250AnalysisManager.hh:6,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:39:
/opt/root6/include/root/TString.h: In function ‘UInt_t Hash(const TString*)’:
/opt/root6/include/root/TString.h:460:36: attention : declaration of ‘s’ shadows a global declaration [-Wshadow]
 inline UInt_t Hash(const TString *s) { return s->Hash(); }
                                    ^
In file included from /opt/geant4/include/Geant4/CLHEP/Units/PhysicalConstants.h:42:0,
                 from /opt/geant4/include/Geant4/G4ParticleDefinition.hh:58,
                 from /opt/geant4/include/Geant4/G4ParticleGun.hh:37,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250PrimaryGeneratorAction.hh:35,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:32:
/opt/geant4/include/Geant4/CLHEP/Units/SystemOfUnits.h:148:24: note: shadowed declaration is here
   static const double  s = second;
                        ^
In file included from /opt/root6/include/root/TNamed.h:29:0,
                 from /opt/root6/include/root/TDirectory.h:25,
                 from /opt/root6/include/root/TROOT.h:29,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250AnalysisManager.hh:6,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:39:
/opt/root6/include/root/TString.h: In member function ‘TString& TString::Append(const TString&)’:
/opt/root6/include/root/TString.h:498:49: attention : declaration of ‘s’ shadows a global declaration [-Wshadow]
 inline TString &TString::Append(const TString &s)
                                                 ^
In file included from /opt/geant4/include/Geant4/CLHEP/Units/PhysicalConstants.h:42:0,
                 from /opt/geant4/include/Geant4/G4ParticleDefinition.hh:58,
                 from /opt/geant4/include/Geant4/G4ParticleGun.hh:37,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250PrimaryGeneratorAction.hh:35,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:32:
/opt/geant4/include/Geant4/CLHEP/Units/SystemOfUnits.h:148:24: note: shadowed declaration is here
   static const double  s = second;
                        ^
In file included from /opt/root6/include/root/TNamed.h:29:0,
                 from /opt/root6/include/root/TDirectory.h:25,
                 from /opt/root6/include/root/TROOT.h:29,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250AnalysisManager.hh:6,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:39:
/opt/root6/include/root/TString.h: In member function ‘TString& TString::Append(const TString&, Ssiz_t)’:
/opt/root6/include/root/TString.h:501:59: attention : declaration of ‘s’ shadows a global declaration [-Wshadow]
 inline TString &TString::Append(const TString &s, Ssiz_t n)
                                                           ^
In file included from /opt/geant4/include/Geant4/CLHEP/Units/PhysicalConstants.h:42:0,
                 from /opt/geant4/include/Geant4/G4ParticleDefinition.hh:58,
                 from /opt/geant4/include/Geant4/G4ParticleGun.hh:37,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250PrimaryGeneratorAction.hh:35,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:32:
/opt/geant4/include/Geant4/CLHEP/Units/SystemOfUnits.h:148:24: note: shadowed declaration is here
   static const double  s = second;
                        ^
In file included from /opt/root6/include/root/TNamed.h:29:0,
                 from /opt/root6/include/root/TDirectory.h:25,
                 from /opt/root6/include/root/TROOT.h:29,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250AnalysisManager.hh:6,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:39:
/opt/root6/include/root/TString.h: In member function ‘TString& TString::operator+=(const TString&)’:
/opt/root6/include/root/TString.h:507:53: attention : declaration of ‘s’ shadows a global declaration [-Wshadow]
 inline TString &TString::operator+=(const TString &s)
                                                     ^
In file included from /opt/geant4/include/Geant4/CLHEP/Units/PhysicalConstants.h:42:0,
                 from /opt/geant4/include/Geant4/G4ParticleDefinition.hh:58,
                 from /opt/geant4/include/Geant4/G4ParticleGun.hh:37,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250PrimaryGeneratorAction.hh:35,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:32:
/opt/geant4/include/Geant4/CLHEP/Units/SystemOfUnits.h:148:24: note: shadowed declaration is here
   static const double  s = second;
                        ^
In file included from /opt/root6/include/root/TNamed.h:29:0,
                 from /opt/root6/include/root/TDirectory.h:25,
                 from /opt/root6/include/root/TROOT.h:29,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250AnalysisManager.hh:6,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:39:
/opt/root6/include/root/TString.h: In member function ‘TString& TString::operator+=(Long_t)’:
/opt/root6/include/root/TString.h:514:12: attention : declaration of ‘s’ shadows a global declaration [-Wshadow]
 { char s[32]; sprintf(s, "%ld", i); return operator+=(s); }
            ^
In file included from /opt/geant4/include/Geant4/CLHEP/Units/PhysicalConstants.h:42:0,
                 from /opt/geant4/include/Geant4/G4ParticleDefinition.hh:58,
                 from /opt/geant4/include/Geant4/G4ParticleGun.hh:37,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250PrimaryGeneratorAction.hh:35,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:32:
/opt/geant4/include/Geant4/CLHEP/Units/SystemOfUnits.h:148:24: note: shadowed declaration is here
   static const double  s = second;
                        ^
In file included from /opt/root6/include/root/TNamed.h:29:0,
                 from /opt/root6/include/root/TDirectory.h:25,
                 from /opt/root6/include/root/TROOT.h:29,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250AnalysisManager.hh:6,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:39:
/opt/root6/include/root/TString.h: In member function ‘TString& TString::operator+=(ULong_t)’:
/opt/root6/include/root/TString.h:517:12: attention : declaration of ‘s’ shadows a global declaration [-Wshadow]
 { char s[32]; sprintf(s, "%lu", i); return operator+=(s); }
            ^
In file included from /opt/geant4/include/Geant4/CLHEP/Units/PhysicalConstants.h:42:0,
                 from /opt/geant4/include/Geant4/G4ParticleDefinition.hh:58,
                 from /opt/geant4/include/Geant4/G4ParticleGun.hh:37,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250PrimaryGeneratorAction.hh:35,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:32:
/opt/geant4/include/Geant4/CLHEP/Units/SystemOfUnits.h:148:24: note: shadowed declaration is here
   static const double  s = second;
                        ^
In file included from /opt/root6/include/root/TNamed.h:29:0,
                 from /opt/root6/include/root/TDirectory.h:25,
                 from /opt/root6/include/root/TROOT.h:29,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250AnalysisManager.hh:6,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:39:
/opt/root6/include/root/TString.h: In member function ‘TString& TString::operator+=(Double_t)’:
/opt/root6/include/root/TString.h:533:13: attention : declaration of ‘s’ shadows a global declaration [-Wshadow]
    char s[32];
             ^
In file included from /opt/geant4/include/Geant4/CLHEP/Units/PhysicalConstants.h:42:0,
                 from /opt/geant4/include/Geant4/G4ParticleDefinition.hh:58,
                 from /opt/geant4/include/Geant4/G4ParticleGun.hh:37,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250PrimaryGeneratorAction.hh:35,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:32:
/opt/geant4/include/Geant4/CLHEP/Units/SystemOfUnits.h:148:24: note: shadowed declaration is here
   static const double  s = second;
                        ^
In file included from /opt/root6/include/root/TNamed.h:29:0,
                 from /opt/root6/include/root/TDirectory.h:25,
                 from /opt/root6/include/root/TROOT.h:29,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250AnalysisManager.hh:6,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:39:
/opt/root6/include/root/TString.h: In member function ‘TString& TString::operator+=(Long64_t)’:
/opt/root6/include/root/TString.h:544:13: attention : declaration of ‘s’ shadows a global declaration [-Wshadow]
    char s[32];
             ^
In file included from /opt/geant4/include/Geant4/CLHEP/Units/PhysicalConstants.h:42:0,
                 from /opt/geant4/include/Geant4/G4ParticleDefinition.hh:58,
                 from /opt/geant4/include/Geant4/G4ParticleGun.hh:37,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250PrimaryGeneratorAction.hh:35,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:32:
/opt/geant4/include/Geant4/CLHEP/Units/SystemOfUnits.h:148:24: note: shadowed declaration is here
   static const double  s = second;
                        ^
In file included from /opt/root6/include/root/TNamed.h:29:0,
                 from /opt/root6/include/root/TDirectory.h:25,
                 from /opt/root6/include/root/TROOT.h:29,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250AnalysisManager.hh:6,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:39:
/opt/root6/include/root/TString.h: In member function ‘TString& TString::operator+=(ULong64_t)’:
/opt/root6/include/root/TString.h:552:13: attention : declaration of ‘s’ shadows a global declaration [-Wshadow]
    char s[32];
             ^
In file included from /opt/geant4/include/Geant4/CLHEP/Units/PhysicalConstants.h:42:0,
                 from /opt/geant4/include/Geant4/G4ParticleDefinition.hh:58,
                 from /opt/geant4/include/Geant4/G4ParticleGun.hh:37,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250PrimaryGeneratorAction.hh:35,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:32:
/opt/geant4/include/Geant4/CLHEP/Units/SystemOfUnits.h:148:24: note: shadowed declaration is here
   static const double  s = second;
                        ^
In file included from /opt/root6/include/root/TNamed.h:29:0,
                 from /opt/root6/include/root/TDirectory.h:25,
                 from /opt/root6/include/root/TROOT.h:29,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250AnalysisManager.hh:6,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:39:
/opt/root6/include/root/TString.h: In member function ‘Bool_t TString::BeginsWith(const char*, TString::ECaseCompare) const’:
/opt/root6/include/root/TString.h:558:68: attention : declaration of ‘s’ shadows a global declaration [-Wshadow]
 inline Bool_t TString::BeginsWith(const char *s, ECaseCompare cmp) const
                                                                    ^
In file included from /opt/geant4/include/Geant4/CLHEP/Units/PhysicalConstants.h:42:0,
                 from /opt/geant4/include/Geant4/G4ParticleDefinition.hh:58,
                 from /opt/geant4/include/Geant4/G4ParticleGun.hh:37,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250PrimaryGeneratorAction.hh:35,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:32:
/opt/geant4/include/Geant4/CLHEP/Units/SystemOfUnits.h:148:24: note: shadowed declaration is here
   static const double  s = second;
                        ^
In file included from /opt/root6/include/root/TNamed.h:29:0,
                 from /opt/root6/include/root/TDirectory.h:25,
                 from /opt/root6/include/root/TROOT.h:29,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250AnalysisManager.hh:6,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:39:
/opt/root6/include/root/TString.h: In member function ‘Bool_t TString::Contains(const char*, TString::ECaseCompare) const’:
/opt/root6/include/root/TString.h:567:66: attention : declaration of ‘s’ shadows a global declaration [-Wshadow]
 inline Bool_t TString::Contains(const char *s, ECaseCompare cmp) const
                                                                  ^
In file included from /opt/geant4/include/Geant4/CLHEP/Units/PhysicalConstants.h:42:0,
                 from /opt/geant4/include/Geant4/G4ParticleDefinition.hh:58,
                 from /opt/geant4/include/Geant4/G4ParticleGun.hh:37,
                 from /home/pamputt/dev/simu/Ge250/include/Ge250PrimaryGeneratorAction.hh:35,
                 from /home/pamputt/dev/simu/Ge250/src/Ge250RunAction.cc:32:
/opt/geant4/include/Geant4/CLHEP/Units/SystemOfUnits.h:148:24: note: shadowed declaration is here
   static const double  s = second;
                        ^
(...)

Do you know how to silence (or remove) this kind of warning?

Add to your compiler flags -Wno-shadow

Actually, I would like to be able to detect the shadow in my own code so I guess I cannot use this flag. Bascially I do not know if there is something I can do from the user space. Maybe something maybe modified in the ROOT code or the GEANT4 code to suppress these warnings.

From your source code, remove all “using namespace CLHEP;” and use explicitly “CLHEP::s” where you need it.

I have no “using namespace CLHEP;” in my own code so I guess all of them come from the GEANT4 code.
If so, I do not think the GEANT4 developers would agree to force user to use “CLHEP::s” instead of only “s” because it is nowadays wiedely use in the GEANT4 simulation.
So I do not know if there is something to do within the ROOT code to avoid that.

No header file of Geant4 brings “using namespace CLHEP” nor header files from ROOT, obviously, so it is in your code that the using namespace CLHEP is declared. Please check in your .hh or .cc files.

Hi,

proj-clhep.web.cern.ch/proj-clh … ource.html shows that s is on global scope.

Yikes.

Cheers, Axel.

…to clarify: this is not a ROOT issue. This is an absurdity in CLHEP. SystemOfUnits.h should not be #include’d in any header file…

Cheers, Axel.

The “SystemOfUnits.h” doxygen page that you show is completely outdated (it’s CLHEP 1.8.x.y from 2002).
Any decent version uses the CLHEP namespace.
They all contain, however:

#ifdef ENABLE_BACKWARDS_COMPATIBILITY
//  backwards compatibility will be enabled ONLY in CLHEP 1.9
using namespace CLHEP;
#endif

So, it seems that one may have problems with ROOT and CLHEP 1.9.x.y but it should work fine with CLHEP 2.0.x.y or 2.1.x.y or newer.

Hello, I am getting the same warning message (running geant version 4.10.1 and root version 5.34). Haven’t been able to fix it. Regards, Oliver

I have just downloaded Linux binary releases of Geant4 10.1.2 (CLHEP 2.2.0.4) and Geant4 10.2.0 (CLHEP 2.3.1.1) provided by the Geant4 team.
In both cases, “SystemOfUnits.h” contains “namespace CLHEP” (the “ENABLE_BACKWARDS_COMPATIBILITY” feature is removed completely from these new CLHEP releases) and there is NO single place which says “using namespace CLHEP;”.

I am sure to understand verything from the technical part. What I can say is I do not have any “using namespace CLHEP;” in my code. I attach all my code if you want to check by yourself. To compile you have to go to Ge250/build and type “cmake …”, then “make”. And you will see all these warning messages.

PS : I am using ROOT 6.06/00 and GEANT4.10.2
simu.tar.gz (34.7 KB)

The problem is that your code includes G4SystemOfUnits.hh and this is [almost] equivalent to using namespace CLHEP.
See www-zeuthen.desy.de/geant4/gean … ource.html

You could play by changing the order of file includes. For example in Ge250RunAction.cc if you invert the following two lines you could probably get away of these warnings.

#include "G4SystemOfUnits.hh"
#include "Ge250AnalysisManager.hh"

Indeed, this was the problem. Including “my” headers before the GEANT4 ones solves this “issue”. Thank you.

The exact error is that in file SystemOfUnits.hh s is globally declared as s = seconds. On the other hand the TString.h header file of ROOT uses the same variable name s as a pointer in this line

inline TBuffer &operator>>(TBuffer &buf, Short_t &s) { buf.ReadShort(s); return buf; }

This creates a conflict and hence the error.

Please don’t resurrect a 3 year old topic, but post your question as a new topic, referencing this topic by posting its URL.

In that new topic, please copy & paste the actual warning you see. Thanks!

Cheers, Axel.