qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 15/15] Use gcc warning flag -Wnested-externs, fix wa


From: Blue Swirl
Subject: [Qemu-devel] [PATCH 15/15] Use gcc warning flag -Wnested-externs, fix warnings
Date: Sun, 5 Sep 2010 15:07:31 +0000

If the compiler supports the warning flag -Wnested-externs, use it.

Fix the only warning by moving the xml_builtin declaration to a more
proper place.

Signed-off-by: Blue Swirl <address@hidden>
---
 configure       |    2 +-
 feature_to_c.sh |    1 -
 gdbstub.c       |    1 -
 gdbstub.h       |    3 +++
 4 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index 61626b8..78829e9 100755
--- a/configure
+++ b/configure
@@ -140,7 +140,7 @@ LDFLAGS="-g $LDFLAGS"

 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 -Wclobbered -Wempty-body $gcc_flags"
+gcc_flags="-Wmissing-include-dirs -Wclobbered -Wempty-body
-Wnested-externs $gcc_flags"
 gcc_flags="-fstack-protector-all $gcc_flags"
 cat > $TMPC << EOF
 int main(void) { return 0; }
diff --git a/feature_to_c.sh b/feature_to_c.sh
index dbf9f19..0994d95 100644
--- a/feature_to_c.sh
+++ b/feature_to_c.sh
@@ -63,7 +63,6 @@ for input; do
 done

 echo >> $output
-echo "extern const char *const xml_builtin[][2];" >> $output
 echo "const char *const xml_builtin[][2] = {" >> $output

 for input; do
diff --git a/gdbstub.c b/gdbstub.c
index 2b03ef2..0aa081b 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -1504,7 +1504,6 @@ static int memtox(char *buf, const char *mem, int len)

 static const char *get_feature_xml(const char *p, const char **newp)
 {
-    extern const char *const xml_builtin[][2];
     size_t len;
     int i;
     const char *name;
diff --git a/gdbstub.h b/gdbstub.h
index 219abda..ce5fdcc 100644
--- a/gdbstub.h
+++ b/gdbstub.h
@@ -38,4 +38,7 @@ int gdbserver_start(int);
 int gdbserver_start(const char *port);
 #endif

+/* in gdbstub-xml.c, generated by feature_to_c.sh */
+extern const char *const xml_builtin[][2];
+
 #endif
-- 
1.6.2.4



reply via email to

[Prev in Thread] Current Thread [Next in Thread]