]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
add -Wold-style-declaration
authorTom Tromey <tromey@redhat.com>
Mon, 1 Jul 2013 19:50:11 +0000 (19:50 +0000)
committerTom Tromey <tromey@redhat.com>
Mon, 1 Jul 2013 19:50:11 +0000 (19:50 +0000)
This adds -Wold-style-declaration to gdb's list of warnings.

It turns out that a few places use "const static" rather than
"static const".  The former is deprecated according to the C standard.

Tested by rebuilding with --enable-targets=all on x86-64 Fedora 18.

* configure.ac (build_warnings): Add -Wold-style-declaration.
* configure: Rebuild.
* dsrec.c (make_srec): Use "static const", not "const static".
* h8300-tdep.c (h8300_breakpoint_from_pc): Use "static const",
not "const static".
* mi/mi-parse.c (mi_no_values, mi_simple_values, mi_all_values):
Use "static const", not "const static".
* mn10300-tdep.c (mn10300_breakpoint_from_pc): Use "static const",
not "const static".
* moxie-tdep.c (moxie_breakpoint_from_pc): Use "static const",
not "const static".
* rs6000-tdep.c (rs6000_breakpoint_from_pc): Use "static const",
not "const static".
* v850-tdep.c (v850_breakpoint_from_pc): Use "static const",
not "const static".
(v850_dbtrap_breakpoint_from_pc): Likewise.
* xstormy16-tdep.c (xstormy16_breakpoint_from_pc): Use "static const",
not "const static".

gdb/ChangeLog
gdb/configure
gdb/configure.ac
gdb/dsrec.c
gdb/h8300-tdep.c
gdb/mi/mi-parse.c
gdb/mn10300-tdep.c
gdb/moxie-tdep.c
gdb/rs6000-tdep.c
gdb/v850-tdep.c
gdb/xstormy16-tdep.c

index 7ef6dbbdaad4f63214f3356506ede011fb4f05bd..6e2d3550244aedccaf6f04534165556cdd9eb36e 100644 (file)
@@ -1,3 +1,24 @@
+2013-07-01  Tom Tromey  <tromey@redhat.com>
+
+       * configure.ac (build_warnings): Add -Wold-style-declaration.
+       * configure: Rebuild.
+       * dsrec.c (make_srec): Use "static const", not "const static".
+       * h8300-tdep.c (h8300_breakpoint_from_pc): Use "static const",
+       not "const static".
+       * mi/mi-parse.c (mi_no_values, mi_simple_values, mi_all_values):
+       Use "static const", not "const static".
+       * mn10300-tdep.c (mn10300_breakpoint_from_pc): Use "static const",
+       not "const static".
+       * moxie-tdep.c (moxie_breakpoint_from_pc): Use "static const",
+       not "const static".
+       * rs6000-tdep.c (rs6000_breakpoint_from_pc): Use "static const",
+       not "const static".
+       * v850-tdep.c (v850_breakpoint_from_pc): Use "static const",
+       not "const static".
+       (v850_dbtrap_breakpoint_from_pc): Likewise.
+       * xstormy16-tdep.c (xstormy16_breakpoint_from_pc): Use "static const",
+       not "const static".
+
 2013-07-01  Tom Tromey  <tromey@redhat.com>
 
        * configure.ac (build_warnings): Add -Wmissing-parameter-type.
index ac2ff5f4c658b150badcb46df9981de40f43824d..7e08fba659e91d32205a7e851d035642f6d2b1da 100755 (executable)
@@ -12470,7 +12470,8 @@ build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \
 -Wpointer-sign \
 -Wno-unused -Wunused-value -Wunused-function \
 -Wno-switch -Wno-char-subscripts -Wmissing-prototypes \
--Wdeclaration-after-statement -Wempty-body -Wmissing-parameter-type"
+-Wdeclaration-after-statement -Wempty-body -Wmissing-parameter-type \
+-Wold-style-declaration"
 
 # Enable -Wno-format by default when using gcc on mingw since many
 # GCC versions complain about %I64.
index b63faec587b7fd30bdf7014051a59734c3db6d61..e0e5dd4efdecb6b885ad30e434927b84110302a2 100644 (file)
@@ -1940,7 +1940,8 @@ build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \
 -Wpointer-sign \
 -Wno-unused -Wunused-value -Wunused-function \
 -Wno-switch -Wno-char-subscripts -Wmissing-prototypes \
--Wdeclaration-after-statement -Wempty-body -Wmissing-parameter-type"
+-Wdeclaration-after-statement -Wempty-body -Wmissing-parameter-type \
+-Wold-style-declaration"
 
 # Enable -Wno-format by default when using gcc on mingw since many
 # GCC versions complain about %I64.
index 04dd9c6f1192d835ecfcb9d4476eaa6504c9756d..bc47f849dcf283cea3233e4ffbd8f50b9e7c2075 100644 (file)
@@ -226,10 +226,10 @@ make_srec (char *srec, CORE_ADDR targ_addr, bfd *abfd, asection *sect,
 {
   unsigned char checksum;
   int tmp;
-  const static char hextab[] = "0123456789ABCDEF";
-  const static char data_code_table[] = "123";
-  const static char term_code_table[] = "987";
-  const static char header_code_table[] = "000";
+  static const char hextab[] = "0123456789ABCDEF";
+  static const char data_code_table[] = "123";
+  static const char term_code_table[] = "987";
+  static const char header_code_table[] = "000";
   char const *code_table;
   int addr_size;
   int payload_size;
index 0e9d6c4b8a8765c92adf24322720af31a8227988..ef80247b5487a7628f56149f585746b179046592 100644 (file)
@@ -1192,7 +1192,7 @@ h8300s_dbg_reg_to_regnum (struct gdbarch *gdbarch, int regno)
   return regno;
 }
 
-const static unsigned char *
+static const unsigned char *
 h8300_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr,
                          int *lenptr)
 {
index 0f35f1d6d2aff95b1e5f0480c2333d8a85af2a60..a3c184910bf1e773cf4ad5c56f7a59021fcb8fd9 100644 (file)
@@ -28,9 +28,9 @@
 #include "gdb_string.h"
 #include "cli/cli-utils.h"
 
-const static char mi_no_values[] = "--no-values";
-const static char mi_simple_values[] = "--simple-values";
-const static char mi_all_values[] = "--all-values";
+static const char mi_no_values[] = "--no-values";
+static const char mi_simple_values[] = "--simple-values";
+static const char mi_all_values[] = "--all-values";
 
 /* Like parse_escape, but leave the results as a host char, not a
    target char.  */
index c31af8d79da2d0b3b05808808437faca24f89441..32aa5f5c5b3024691f33c81c58e8571993eff354 100644 (file)
@@ -326,7 +326,7 @@ mn10300_write_pc (struct regcache *regcache, CORE_ADDR val)
    so we need a single byte breakpoint.  Matsushita hasn't defined
    one, so we defined it ourselves.  */
 
-const static unsigned char *
+static const unsigned char *
 mn10300_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *bp_addr,
                            int *bp_size)
 {
index 79d160b21c491846e6e5a8e998b7ccac0cf2c013..cb04786d0a13fb67f5d53e066fdbf7ae0df54ac8 100644 (file)
@@ -72,7 +72,7 @@ moxie_frame_align (struct gdbarch *gdbarch, CORE_ADDR sp)
 
 /* Implement the "breakpoint_from_pc" gdbarch method.  */
 
-const static unsigned char *
+static const unsigned char *
 moxie_breakpoint_from_pc (struct gdbarch *gdbarch,
                          CORE_ADDR *pcptr, int *lenptr)
 {
index d3ff09d8bfa1c9954649103f8b018b0605b7eca1..59e129f318e69ecd462972f9ca4fb42f08a92e4d 100644 (file)
@@ -943,7 +943,7 @@ rs6000_fetch_pointer_argument (struct frame_info *frame, int argi,
 
 /* Sequence of bytes for breakpoint instruction.  */
 
-const static unsigned char *
+static const unsigned char *
 rs6000_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *bp_addr,
                           int *bp_size)
 {
index 16fe825ee620d0e9c0309abb3ad3faee32e7da26..becb0512c6a97dc7ab68d03e5974d7a3e7479ff8 100644 (file)
@@ -1170,7 +1170,7 @@ v850_return_value (struct gdbarch *gdbarch, struct value *function,
   return RETURN_VALUE_REGISTER_CONVENTION;
 }
 
-const static unsigned char *
+static const unsigned char *
 v850_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr,
                          int *lenptr)
 {
@@ -1184,7 +1184,7 @@ v850_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr,
    Older architectures had no such instruction.  For those, an
    unconditional branch to self instruction is used.  */
 
-const static unsigned char *
+static const unsigned char *
 v850_dbtrap_breakpoint_from_pc (struct gdbarch *gdbarch,
                                 CORE_ADDR *pcptr, int *lenptr)
 {
index cb551ff2209c03c6cd8ad57782730d0dc6c383b7..99b0c5e0cc9ac9f1766044dd4e68ca677db59549 100644 (file)
@@ -505,7 +505,7 @@ xstormy16_in_function_epilogue_p (struct gdbarch *gdbarch, CORE_ADDR pc)
   return 0;
 }
 
-const static unsigned char *
+static const unsigned char *
 xstormy16_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr,
                              int *lenptr)
 {