gnucash maint: Multiple changes pushed

Geert Janssens janssens-geert at telenet.be
Fri May 2 09:19:06 EDT 2014


On Sunday 27 April 2014 16:29:11 Mike Alexander wrote:
> Updated	 via  https://github.com/Gnucash/gnucash/commit/2c4463e7
> (commit) via  https://github.com/Gnucash/gnucash/commit/4ec1f6b7
> (commit) from  https://github.com/Gnucash/gnucash/commit/fb8018b3
> (commit)
(snip)
> 
> commit 4ec1f6b724165b281842fda45769694e231c4027
> Author: Mike Alexander <mta at umich.edu>
> Date:   Fri Apr 25 23:32:25 2014 -0400
> 
>     Fix code that customizes parameters for specific gcc versions
>     to agree with the comments.
> 
> diff --git a/configure.ac b/configure.ac
> index 55000e3..553be43 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1305,18 +1305,18 @@ then
>    # -Wdeclaration-after-statement in order to preserve source code
>    # compatibility to gcc 2.95 and other compilers.
>    GCC_VERSION=`${CC} -dumpversion`
> -  if test "`echo ${GCC_VERSION} | cut -d. -f1`" -ge 3; then
> -    # This is gcc >= 3.x.x
> +  if test "`echo ${GCC_VERSION} | cut -d. -f1`" -eq 3; then
> +    # This is gcc 3.x.x
>      if test "`echo ${GCC_VERSION} | cut -d. -f2`" -ge 4; then
>        # This is gcc >= 3.4.x
>        warnFLAGS="${warnFLAGS} -Wdeclaration-after-statement"
> -    else if test "`echo ${GCC_VERSION} | cut -d. -f1`" -ge 4; then
> -           # This is gcc == 4.x.x
> -           warnFLAGS="${warnFLAGS} -Wdeclaration-after-statement
> -Wno-pointer-sign" -           # rpmbuild on FC4 forces this flag.
> Can't hurt to always compile with it. -          
> warnFLAGS="${warnFLAGS} -D_FORTIFY_SOURCE=2"
> -         fi
>      fi
> +  else if test "`echo ${GCC_VERSION} | cut -d. -f1`" -ge 4; then
> +         # This is gcc >= 4.x.x
> +         warnFLAGS="${warnFLAGS} -Wdeclaration-after-statement
> -Wno-pointer-sign" +         # rpmbuild on FC4 forces this flag.
> Can't hurt to always compile with it. +        
> warnFLAGS="${warnFLAGS} -D_FORTIFY_SOURCE=2"
> +       fi
>    fi
>    CFLAGS="${warnFLAGS} ${CFLAGS}"
>  else
> 
This commit breaks the build on my system (ironically a Fedora system).

The _FORTIFY_SOURCE addition results in the following compile error:
/usr/include/features.h:327:4: error: #warning _FORTIFY_SOURCE requires compiling with 
optimization (-O) [-Werror=cpp]
 #  warning _FORTIFY_SOURCE requires compiling with optimization (-O)

Due to the incorrect logic the part adding _FORTIFY_SOURCE was never reached before this 
patch. It now is but it looks like it shouldn't be added unconditionally because it needs to 
build with optimization enabled.

Geert


More information about the gnucash-devel mailing list