]> git.proxmox.com Git - qemu.git/commitdiff
Use gcc warning flag -Wnested-externs
authorBlue Swirl <blauwirbel@gmail.com>
Sat, 18 Sep 2010 07:02:16 +0000 (07:02 +0000)
committerBlue Swirl <blauwirbel@gmail.com>
Sat, 18 Sep 2010 07:02:16 +0000 (07:02 +0000)
If the compiler supports the warning flag -Wnested-externs, use it.

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

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
configure
feature_to_c.sh
gdbstub.c
gdbstub.h

index 80497aab75af287b25bc75694f0dc4355551a624..232ba743ef2269944d4741abccd6a64c92fc8254 100755 (executable)
--- 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 -Wempty-body $gcc_flags"
+gcc_flags="-Wmissing-include-dirs -Wempty-body -Wnested-externs $gcc_flags"
 gcc_flags="-fstack-protector-all $gcc_flags"
 cat > $TMPC << EOF
 int main(void) { return 0; }
index dbf9f19c91dc0b5cd1af9ca8420912724f0f4e9c..0994d9546edeb894c3db9bae09cd5be524de8221 100644 (file)
@@ -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
index 2b03ef2aa0478866456a07c03554cfed77ed9835..0aa081b13b8293d36602fe7e086adf3f706e3679 100644 (file)
--- 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;
index 219abdab0e16315f7d34b9ab6ba19825719fc208..ce5fdcc2238e90bdb004e304937a49a841c32008 100644 (file)
--- 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