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".
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.
* configure: Rebuild.
-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.
-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.
{
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;
return regno;
}
-const static unsigned char *
+static const unsigned char *
h8300_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr,
int *lenptr)
{
#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. */
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)
{
/* 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)
{
/* 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)
{
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)
{
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)
{
return 0;
}
-const static unsigned char *
+static const unsigned char *
xstormy16_breakpoint_from_pc (struct gdbarch *gdbarch, CORE_ADDR *pcptr,
int *lenptr)
{