Hello,
I am also receiving the error
src/EventDict.cc:1880: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object
.
This compilation warning did not occur until an update from gcc-3.1 to gcc-4.1. I have learned that, yes, ISO C++ does forbid the casting, and I don’t see how the error described above, the TString* definition, would cause a problem in my case. In the interest of not posting huge amounts of code, I have included a only a bit. Event.h below is shown below.
[code]class Event : public TObject {
private:
EventHeader fEvtHdr;
Primary fPrimary[NUM_PRIMARY];
Detector fDetector[NUM_DETECTOR];
public:
Event();
virtual ~Event();
void Build(Int_t ev, Int_t arg5=600, Float_t ptmin=1);
void Clear(Option_t *option ="");
void SetHeader(Int_t eventNum, Int_t run, Int_t date, Double_t beta,
Double_t EmisPosX, Double_t EmisPosY, Double_t EmisPosZ,
Double_t ProjMomX, Double_t ProjMomY, Double_t ProjMomZ);
void SetPrimary(Int_t index, Double_t beta,
Double_t energy, Double_t theta, Double_t phi,
Double_t pfEnergy, Double_t pfTheta, Double_t pfPhi);
void SetDetector(Int_t index, Int_t numHits,
Double_t firstHitX, Double_t firstHitY, Double_t firstHitZ,
Double_t energyDep, Double_t energyUp, Double_t energyDn,
Double_t energyRec, Double_t energyRecDop, Double_t positionRec);
EventHeader* GetHeader();
Primary* GetPrimary(Int_t index);
Detector* GetDetector(Int_t index);
ClassDef(Event,1) //Event structure
};
[/code]
The errors come from the lines marked with an ! in EventDict.cc, and are repeated for the similar lines in the EventHeader, Primary, and Detector classes. In function ‘void G__setup_memfuncEvent()’:
! G__memfunc_setup("Class",502,G__EventDict_478_0_10, 85, G__get_linked_tagnum(&G__EventDictLN_TClass), -1, 0, 0, 3, 1, 0, "", (char*)NULL, (void*) (TClass* (*)())(&Event::Class), 0);
! G__memfunc_setup("Class_Name",982,G__EventDict_478_0_11, 67, -1, -1, 0, 0, 3, 1, 1, "", (char*)NULL, (void*) (const char* (*)())(&Event::Class_Name), 0);
! G__memfunc_setup("Class_Version",1339,G__EventDict_478_0_12, 115, -1, G__defined_typename("Version_t"), 0, 0, 3, 1, 0, "", (char*)NULL, (void*) (Version_t (*)())(&Event::Class_Version), 0);
! G__memfunc_setup("Dictionary",1046,G__EventDict_478_0_13, 121, -1, -1, 0, 0, 3, 1, 0, "", (char*)NULL, (void*) (void (*)())(&Event::Dictionary), 0);
G__memfunc_setup("IsA",253,G__EventDict_478_0_14, 85, G__get_linked_tagnum(&G__EventDictLN_TClass), -1, 0, 0, 1, 1, 8, "", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("ShowMembers",1132,G__EventDict_478_0_15, 121, -1, -1, 0, 2, 1, 1, 0,
"u 'TMemberInspector' - 1 - insp C - - 0 - parent", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("Streamer",835,G__EventDict_478_0_16, 121, -1, -1, 0, 1, 1, 1, 0, "u 'TBuffer' - 1 - b", (char*)NULL, (void*) NULL, 1);
G__memfunc_setup("StreamerNVirtual",1656,G__EventDict_478_0_17, 121, -1, -1, 0, 1, 1, 1, 0, "u 'TBuffer' - 1 - b", (char*)NULL, (void*) NULL, 0);
! G__memfunc_setup("DeclFileName",1145,G__EventDict_478_0_18, 67, -1, -1, 0, 0, 3, 1, 1, "", (char*)NULL, (void*) (const char* (*)())(&Event::DeclFileName), 0);
! G__memfunc_setup("ImplFileLine",1178,G__EventDict_478_0_19, 105, -1, -1, 0, 0, 3, 1, 0, "", (char*)NULL, (void*) (int (*)())(&Event::ImplFileLine), 0);
! G__memfunc_setup("ImplFileName",1171,G__EventDict_478_0_20, 67, -1, -1, 0, 0, 3, 1, 1, "", (char*)NULL, (void*) (const char* (*)())(&Event::ImplFileName), 0);
! G__memfunc_setup("DeclFileLine",1152,G__EventDict_478_0_21, 105, -1, -1, 0, 0, 3, 1, 0, "", (char*)NULL, (void*) (int (*)())(&Event::DeclFileLine), 0);
Thank you for your help.