Hide Forgot
Building the dash-7 source rpm using the command rpmbuild --recompile ./qpid-cpp-mrg-0.10-7.el5.src.rpm fails at the file qpid/broker/SessionState.cpp because there is a variable, called "unique" which is unused. which generates a warning which becomes an error which stops the build. because we always set -Werror in gcc. BREW FAILED TO CATCH THIS -- because when it did the configuration, it decided that gcc did not support the -Werror flag. So it didn't use that flag. So the warning just scrolled past, as it went on its merry way. NOTE -- the variable is NOT unused in 'normal' development builds -- because it appears in an assertion. But in a production build -- the assertion is whitespace, and the variable decl is hanging out there all by itself. I am doing a mock build to try to find what caused the configuration failure in brew.
/*--------------------------------------- root cause ---------------------------------------*/ In the brew mock build, just before the configure script is run in the cpp directory, the CXXFLAGS environment variable is set this way: export CXXFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DNDEBUG -O3' This environment variable affects the operation of the GCC compiler. Then, when the configure script is run, GCC reports that it will NOT honor the -Werror flag. So that flag is never used. So warnings are not treated as errors. So we did not notice the warning saying that a variable in one cpp function was unused. ~~~ HOWEVER ~~~ In the rpmbuild process, when I give the normal command: rpmbuild --recompile /path/to/qpid-cpp-mrg-0.10-7.el5.src.rpm it sets a *different* CXXFLAGS value: CXXFLAGS='-O2 -g -m64 -mtune=generic -DNDEBUG -O3' This causes GCC to report that it *will* honor the -Werror flag -- so the build fails. The important difference is the absence of the -Wall flag. If you remove that flag from the brew mock build, i.e. if it were to set this value for CXXFLAGS: export CXXFLAGS='-O2 -g -pipe -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -DNDEBUG -O3' Then everything works right. It looks like there is an undocumented relationship between -Wall and -Werror in gcc. i.e. -Wall disables -Werror
Fixed upstream in revision 1127947
Both qpid-cpp-mrg-0.10-8.el5 qpid-cpp-0.10-6.el6 now build ok - rpmbuild way(-Wall) - custom build way (CXXFLAGS w/o -Wall). Tested on RHEL5.6 / 6.1 i/x. -> VERIFIED