[sword-devel] GCC warnings

Jonathan Marsden jmarsden at fastmail.fm
Fri Dec 4 14:05:35 MST 2009


Matthew Talbert wrote:

> Cross-compiled for Windows on Jaunty with gcc 4.4.2 with -Wall -Werror
> and no problems (well, none related to those arguments).

> Why would the build environment you set up be any different than stock Jaunty?

Because debuild is apparently setting some compiler flags for us
(somehow!).  I'm still looking at the details.

I can now get an svn (non-package) build to error out in the same way my
package builds do, by making a one-character patch to configure.ac, as
follows:

--- configure.ac	(revision 2480)
+++ configure.ac	(working copy)
@@ -90,7 +90,7 @@
     AM_CFLAGS="-O0 -Wall -Werror"
   fi
   if test x$ac_cv_prog_cxx_g = xyes; then
-    AM_CXXFLAGS="-g3 -O0 -Wall -Werror"
+    AM_CXXFLAGS="-g3 -O3 -Wall -Werror"
   else
     AM_CXXFLAGS="-O0 -Wall -Werror"
   fi


Having -O2 or higher enables the -D_FORTIFY_SOURCE=2 security hardening
stuff, which is what is generating the warnings.  The -Werror is then
converting those to errors, and so halting the build process.

See https://wiki.ubuntu.com/CompilerFlags for a bit more info about this
 topic.

What I don't yet know is how -O2 or higher is being enabled in my
package builds...

Jonathan



More information about the sword-devel mailing list