bneijt / ccbuild

C++ source scanning build utility
GNU General Public License v2.0
5 stars 3 forks source link

2.0.2: Fails to build with gcc 4.7.0 #25

Closed jaalto closed 12 years ago

jaalto commented 12 years ago

The code fails to build in Debian with hardened build flags on Gcc 4.7. C.f, http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=667132

(...snip...)
g++ -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -Wall -pedantic -std=gnu++0x -DPACKAGE_NAME=\"ccbuild\" -DPACKAGE_TARNAME=\"ccbuild\" -DPACKAGE_VERSION=\"2.0.2\" -DPACKAGE_STRING=\"ccbuild\ 2.0.2\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"ccbuild\" -DVERSION=\"2.0.2\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_STDBOOL_H=1 -DSTDC_HEADERS=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_STDLIB_H=1 -DHAVE_REALLOC=1 -DLSTAT_FOLLOWS_SLASHED_SYMLINK=1 -DHAVE_GETCWD=1 -DHAVE_MEMSET=1 -DHAVE_MKDIR=1 -I.   -D_FORTIFY_SOURCE=2 -I/usr/include/p11-kit-1    -DNODEBUG -fopenmp -std=c++0x -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Wformat-security -Werror=format-security -Wall -pedantic -std=gnu++0x -std=c++0x -c -o src/system/ccbuild-dotgraphForAll.o `test -f 'src/system/dotgraphForAll.cc' || echo './'`src/system/dotgraphForAll.cc
src/system/dotgraphForAll.cc: In static member function 'static void bneijt::System::dotgraphForAll()':
src/system/dotgraphForAll.cc:50:19: error: redeclaration of 'std::ofstream file'
src/system/dotgraphForAll.cc:28:3: error: '__gnu_cxx::__normal_iterator<std::basic_string<char>*, std::vector<std::basic_string<char> > > file' previously declared here
make[2]: *** [src/system/ccbuild-dotgraphForAll.o] Error 1
bneijt commented 12 years ago

When trying it on my new Mint installation, I even got a Segfault. This needs more work then just a small patch and I will let you know the progress as soon as possible.

Thank you for posting this issue here!

jaalto commented 12 years ago

Bram,

Thanks for looking into this.

Could you also subscribe to Debian bug reports for faster turn around? You can do that from bottom left hand corner of http://packages.qa.debian.org/c/ccbuild.html

Jari

bneijt commented 12 years ago

Release 2.0.3 fixes the shadowing problems. I still have to check out possible compilation errors when using extra security measures with g++-4.7