Patchwork [2/3] Add -Wold-style-* flags

login
register
mail settings
Submitter Juan Quintela
Date Sept. 29, 2009, 11:10 p.m.
Message ID <e36af02ee3ca0d2b2514e2668cb9ca1ccfe6b51a.1254265694.git.quintela@redhat.com>
Download mbox | patch
Permalink /patch/34503/
State Superseded
Headers show

Comments

Juan Quintela - Sept. 29, 2009, 11:10 p.m.
This time, I add them in configure only if target compiler supports it

Signed-off-by: Juan Quintela <quintela@redhat.com>
---
 configure |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)

Patch

diff --git a/configure b/configure
index 8b0db7e..81bcc27 100755
--- a/configure
+++ b/configure
@@ -1653,6 +1653,16 @@  QEMU_CFLAGS="-U_FORTIFY_SOURCE $QEMU_CFLAGS"
 QEMU_CFLAGS="-I. -I\$(SRC_PATH) -MMD -MP -MT \$@ $QEMU_CFLAGS"
 LDFLAGS="-g $LDFLAGS"

+gcc_flags="-Wold-style-declaration -Wold-style-definition"
+cat > $TMPC << EOF
+int main(void) { }
+EOF
+for flag in $gcc_flags; do
+    if compile_prog "$QEMU_CFLAGS" "$flag" ; then
+	QEMU_CFLAGS="$flag $QEMU_CFLAGS"
+    fi
+done
+
 # Consult white-list to determine whether to enable werror
 # by default.  Only enable by default for git builds
 if test -z "$werror" ; then