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

Build fails with gcc 4.9.1 for Release build type #226

Closed
blinkseb opened this issue Apr 2, 2015 · 3 comments
Closed

Build fails with gcc 4.9.1 for Release build type #226

blinkseb opened this issue Apr 2, 2015 · 3 comments

Comments

@blinkseb
Copy link

blinkseb commented Apr 2, 2015

Hi,

I'm trying to build latest xrootd on my ubuntu machine (14.10), shipping with gcc 4.9.1. The build fails with the following error:

/home/sbrochet/build/xrootd-4.1.1/src/XrdXrootd/XrdXrootdJob.cc: In member function ‘void XrdXrootdJob2Do::delClient(XrdXrootdResponse*)’:
/home/sbrochet/build/xrootd-4.1.1/src/XrdXrootd/XrdXrootdJob.cc:261:69: error: array subscript is above array bounds [-Werror=array-bounds]
           {for (j = i+1; j < numClients; j++) Client[i++] = Client[j];
                                                                     ^
/home/sbrochet/build/xrootd-4.1.1/src/XrdXrootd/XrdXrootdJob.cc: In member function ‘int XrdXrootdJob2Do::verClient(int)’:
/home/sbrochet/build/xrootd-4.1.1/src/XrdXrootd/XrdXrootdJob.cc:327:71: error: array subscript is above array bounds [-Werror=array-bounds]
            for (j = i+1; j < numClients; j++,k++) Client[k] = Client[j];
                                                                       ^

I generate the Makefile with the following cmake command:

cmake .. -DCMAKE_INSTALL_PREFIX=$HOME/.local -DCMAKE_BUILD_TYPE=Release

It's interesting to notice that the build works when CMAKE_BUILD_TYPE is not specified.

Thanks

@blinkseb blinkseb changed the title Build fails with gcc 4.9.1 Build fails with gcc 4.9.1 for Release build type Apr 2, 2015
@ljanyst
Copy link
Contributor

ljanyst commented Apr 2, 2015

It works fine with 4.9.2 on Debian Testing. Can you re-try after dropping DCMAKE_BUILD_TYPE=Release? The intended and tested default is RelWithDebInfo. Please make sure to delete the build directory first as these variables get cached by CMake.

@blinkseb
Copy link
Author

blinkseb commented Apr 2, 2015

I tried a default build and it works fine, sorry for the noise here!

Thanks!

@ljanyst
Copy link
Contributor

ljanyst commented Apr 2, 2015

No problem. We see quite a bit compiler glitches. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants