I\'m trying to recompile a huge legacy app with g++ 4.8 in order debug a glibc detected memory corruption
problem (using AddressSanitizer). Previously we used g++
I was able to reproduce your issue using dockerized Centos6, with gcc 4.8.2. After upgrading dev tools to version 6 (gcc 6.3.1), your code compiled without any problem. Try upgrading dev tools using these steps (suggested for testing only):
add sclo centos6 repository via adding file /etc/yum.repos.d/devtools-sclo.repo :
[testing-devtools]
name=devtools multiple for CentOS
baseurl=http://mirror.centos.org/centos/6/sclo/x86_64/rh/
gpgcheck=0
install devtoolset-6 packages:
yum install devtoolset-6-binutils devtoolset-6-gcc-c++
set bash environment to new version:
scl enable devtoolset-6 bash
Now try recompiling your base example and full source.
NOTE: This same repository contains packages for devtoolset-3 and devtoolset-4 also. Very easy to try if ever needed.