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

Compile errors with new raster classes #50

Closed
brash99 opened this issue Mar 6, 2014 · 0 comments
Closed

Compile errors with new raster classes #50

brash99 opened this issue Mar 6, 2014 · 0 comments

Comments

@brash99
Copy link
Contributor

brash99 commented Mar 6, 2014

On MacOSX, I get the following warnings and errors when trying to compile hcana with the new raster classes:

g++ -o src/THcRaster.os -c -O -Wall -Woverloaded-virtual -pthread -pthread -m64 -stdlib=libc++ -fPIC -fPIC -DNDEBUG -DMACVERS -DHAS_SSTREAM -DHALLC_MODS -Isrc -Ipodd/src -Ipodd/hana_decode -Ipodd/hana_scaler -I/Users/brash/Dropbox/root/include src/THcRaster.cxx
In file included from src/THcRaster.cxx:14:
src/THcRaster.h:30:42: warning: array index 2 is past the end of the array (which contains 2 elements) [-Warray-bounds]
TVector3 GetPosition() const { return fPosition[2]; }
^ ~
src/THcRaster.h:52:3: note: array 'fPosition' declared here
TVector3 fPosition[2]; // Beam position at 1st, 2nd BPM or at the target (meters)
^
src/THcRaster.cxx:61:3: error: cannot delete expression of type 'Double_t [2]'
delete [] fPedADC;
^ ~~~~~~~
src/THcRaster.cxx:62:3: error: cannot delete expression of type 'Double_t [2]'
delete [] fAvgPedADC;
^ ~~~~~~~~~~
1 warning and 2 errors generated.
scons: *** [src/THcRaster.os] Error 1
scons: building terminated because of errors.

The error traces to the THcRaster destructor ... commenting out the two delete statements allows hcana to compile, but may cause runtime errors I suppose. I wonder why fPedADC and fAvgPedADC are defined at Double_t types in the first place ...

I also note that the warning appears to be a serious one ... fPosition is indeed defined to be an array of size 2, and so in principle only fPosition[0] and fPosition[1] are meaningful.

As I don't really understand at this point any of the raster code, I won't attempt a fix ... just raising this issue for Buddhini's benefit.

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

No branches or pull requests

2 participants