* [Qemu-devel] [PATCH v2] configure: add -Werror to QEMU_CFLAGS early
@ 2012-07-09 12:38 Alexander Graf
2012-07-14 12:20 ` Blue Swirl
0 siblings, 1 reply; 2+ messages in thread
From: Alexander Graf @ 2012-07-09 12:38 UTC (permalink / raw)
To: qemu-devel qemu-devel; +Cc: Andreas Färber, Gerd Hoffmann
We want all configure tests pass with -Werror if it is enabled. So we
need to update QEMU_CFLAGS early on to make sure we also pass it in to
all the compile test jobs.
This fixes a warning-became-error bug in nss for me with the default
configuration:
In file included from /usr/include/nss3/pkcs11t.h:1780,
from /usr/include/nss3/keythi.h:41,
from /usr/include/nss3/keyt.h:41,
from /usr/include/nss3/pk11pub.h:43,
from libcacard/vcard_emul_nss.c:21:
/usr/include/nss3/pkcs11n.h:365:26: error: "__GNUC_MINOR" is not defined
Signed-off-by: Alexander Graf <agraf@suse.de>
Acked-by: Gerd Hoffmann <kraxel@redhat.com>
---
v1 -> v2:
- fix thinko in parameter list
---
configure | 35 +++++++++++++++++------------------
1 files changed, 17 insertions(+), 18 deletions(-)
diff --git a/configure b/configure
index 9f071b7..11a8b60 100755
--- a/configure
+++ b/configure
@@ -1141,10 +1141,26 @@ else
exit 1
fi
+# Consult white-list to determine whether to enable werror
+# by default. Only enable by default for git builds
+z_version=`cut -f3 -d. $source_path/VERSION`
+
+if test -z "$werror" ; then
+ if test "$z_version" = "50" -a \
+ "$linux" = "yes" ; then
+ werror="yes"
+ else
+ werror="no"
+ fi
+fi
+
gcc_flags="-Wold-style-declaration -Wold-style-definition -Wtype-limits"
gcc_flags="-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers $gcc_flags"
gcc_flags="-Wmissing-include-dirs -Wempty-body -Wnested-externs $gcc_flags"
gcc_flags="-fstack-protector-all -Wendif-labels $gcc_flags"
+if test "$werror" = "yes" ; then
+ gcc_flags="-Werror $gcc_flags"
+fi
cat > $TMPC << EOF
int main(void) { return 0; }
EOF
@@ -2575,7 +2591,7 @@ if test "$libiscsi" != "no" ; then
#include <iscsi/iscsi.h>
int main(void) { iscsi_unmap_sync(NULL,0,0,0,NULL,0); return 0; }
EOF
- if compile_prog "-Werror" "-liscsi" ; then
+ if compile_prog "" "-liscsi" ; then
libiscsi="yes"
LIBS="$LIBS -liscsi"
else
@@ -2879,19 +2895,6 @@ if test "$debug" = "no" ; then
CFLAGS="-O2 -D_FORTIFY_SOURCE=2 $CFLAGS"
fi
-# Consult white-list to determine whether to enable werror
-# by default. Only enable by default for git builds
-z_version=`cut -f3 -d. $source_path/VERSION`
-
-if test -z "$werror" ; then
- if test "$z_version" = "50" -a \
- "$linux" = "yes" ; then
- werror="yes"
- else
- werror="no"
- fi
-fi
-
# Disable zero malloc errors for official releases unless explicitly told to
# enable/disable
if test -z "$zero_malloc" ; then
@@ -2902,10 +2905,6 @@ if test -z "$zero_malloc" ; then
fi
fi
-if test "$werror" = "yes" ; then
- QEMU_CFLAGS="-Werror $QEMU_CFLAGS"
-fi
-
if test "$solaris" = "no" ; then
if $ld --version 2>/dev/null | grep "GNU ld" >/dev/null 2>/dev/null ; then
LDFLAGS="-Wl,--warn-common $LDFLAGS"
--
1.6.0.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH v2] configure: add -Werror to QEMU_CFLAGS early
2012-07-09 12:38 [Qemu-devel] [PATCH v2] configure: add -Werror to QEMU_CFLAGS early Alexander Graf
@ 2012-07-14 12:20 ` Blue Swirl
0 siblings, 0 replies; 2+ messages in thread
From: Blue Swirl @ 2012-07-14 12:20 UTC (permalink / raw)
To: Alexander Graf; +Cc: Gerd Hoffmann, qemu-devel qemu-devel, Andreas Färber
Thanks, applied.
On Mon, Jul 9, 2012 at 12:38 PM, Alexander Graf <agraf@suse.de> wrote:
> We want all configure tests pass with -Werror if it is enabled. So we
> need to update QEMU_CFLAGS early on to make sure we also pass it in to
> all the compile test jobs.
>
> This fixes a warning-became-error bug in nss for me with the default
> configuration:
>
> In file included from /usr/include/nss3/pkcs11t.h:1780,
> from /usr/include/nss3/keythi.h:41,
> from /usr/include/nss3/keyt.h:41,
> from /usr/include/nss3/pk11pub.h:43,
> from libcacard/vcard_emul_nss.c:21:
> /usr/include/nss3/pkcs11n.h:365:26: error: "__GNUC_MINOR" is not defined
>
> Signed-off-by: Alexander Graf <agraf@suse.de>
> Acked-by: Gerd Hoffmann <kraxel@redhat.com>
>
> ---
>
> v1 -> v2:
>
> - fix thinko in parameter list
> ---
> configure | 35 +++++++++++++++++------------------
> 1 files changed, 17 insertions(+), 18 deletions(-)
>
> diff --git a/configure b/configure
> index 9f071b7..11a8b60 100755
> --- a/configure
> +++ b/configure
> @@ -1141,10 +1141,26 @@ else
> exit 1
> fi
>
> +# Consult white-list to determine whether to enable werror
> +# by default. Only enable by default for git builds
> +z_version=`cut -f3 -d. $source_path/VERSION`
> +
> +if test -z "$werror" ; then
> + if test "$z_version" = "50" -a \
> + "$linux" = "yes" ; then
> + werror="yes"
> + else
> + werror="no"
> + fi
> +fi
> +
> gcc_flags="-Wold-style-declaration -Wold-style-definition -Wtype-limits"
> gcc_flags="-Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers $gcc_flags"
> gcc_flags="-Wmissing-include-dirs -Wempty-body -Wnested-externs $gcc_flags"
> gcc_flags="-fstack-protector-all -Wendif-labels $gcc_flags"
> +if test "$werror" = "yes" ; then
> + gcc_flags="-Werror $gcc_flags"
> +fi
> cat > $TMPC << EOF
> int main(void) { return 0; }
> EOF
> @@ -2575,7 +2591,7 @@ if test "$libiscsi" != "no" ; then
> #include <iscsi/iscsi.h>
> int main(void) { iscsi_unmap_sync(NULL,0,0,0,NULL,0); return 0; }
> EOF
> - if compile_prog "-Werror" "-liscsi" ; then
> + if compile_prog "" "-liscsi" ; then
> libiscsi="yes"
> LIBS="$LIBS -liscsi"
> else
> @@ -2879,19 +2895,6 @@ if test "$debug" = "no" ; then
> CFLAGS="-O2 -D_FORTIFY_SOURCE=2 $CFLAGS"
> fi
>
> -# Consult white-list to determine whether to enable werror
> -# by default. Only enable by default for git builds
> -z_version=`cut -f3 -d. $source_path/VERSION`
> -
> -if test -z "$werror" ; then
> - if test "$z_version" = "50" -a \
> - "$linux" = "yes" ; then
> - werror="yes"
> - else
> - werror="no"
> - fi
> -fi
> -
> # Disable zero malloc errors for official releases unless explicitly told to
> # enable/disable
> if test -z "$zero_malloc" ; then
> @@ -2902,10 +2905,6 @@ if test -z "$zero_malloc" ; then
> fi
> fi
>
> -if test "$werror" = "yes" ; then
> - QEMU_CFLAGS="-Werror $QEMU_CFLAGS"
> -fi
> -
> if test "$solaris" = "no" ; then
> if $ld --version 2>/dev/null | grep "GNU ld" >/dev/null 2>/dev/null ; then
> LDFLAGS="-Wl,--warn-common $LDFLAGS"
> --
> 1.6.0.2
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-07-14 12:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-09 12:38 [Qemu-devel] [PATCH v2] configure: add -Werror to QEMU_CFLAGS early Alexander Graf
2012-07-14 12:20 ` Blue Swirl
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.