* [PATCH 2/3] add -Wold-style-declaration
2013-06-17 18:42 [PATCH 0/3] add a few new warning options Tom Tromey
2013-06-17 18:42 ` [PATCH 1/3] add -Wmissing-parameter-type Tom Tromey
@ 2013-06-17 18:42 ` Tom Tromey
2013-07-01 19:49 ` Tom Tromey
2013-06-17 18:59 ` [PATCH 3/3] add -Wold-style-definition Tom Tromey
` (2 subsequent siblings)
4 siblings, 1 reply; 16+ messages in thread
From: Tom Tromey @ 2013-06-17 18:42 UTC (permalink / raw)
To: gdb-patches; +Cc: Tom Tromey
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.
This misses most of the "nat" code, but any needed fixes are trivial.
* 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/configure | 3 ++-
gdb/configure.ac | 3 ++-
gdb/dsrec.c | 8 ++++----
gdb/h8300-tdep.c | 2 +-
gdb/mi/mi-parse.c | 6 +++---
gdb/mn10300-tdep.c | 2 +-
gdb/moxie-tdep.c | 2 +-
gdb/rs6000-tdep.c | 2 +-
gdb/v850-tdep.c | 4 ++--
gdb/xstormy16-tdep.c | 2 +-
10 files changed, 18 insertions(+), 16 deletions(-)
diff --git a/gdb/configure b/gdb/configure
index 7da2e15..0c9ac97 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -12456,7 +12456,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.
diff --git a/gdb/configure.ac b/gdb/configure.ac
index f9c04de..f2cd9dc 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -1929,7 +1929,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.
diff --git a/gdb/dsrec.c b/gdb/dsrec.c
index 04dd9c6..bc47f84 100644
--- a/gdb/dsrec.c
+++ b/gdb/dsrec.c
@@ -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;
diff --git a/gdb/h8300-tdep.c b/gdb/h8300-tdep.c
index 0e9d6c4..ef80247 100644
--- a/gdb/h8300-tdep.c
+++ b/gdb/h8300-tdep.c
@@ -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)
{
diff --git a/gdb/mi/mi-parse.c b/gdb/mi/mi-parse.c
index 0f35f1d..a3c1849 100644
--- a/gdb/mi/mi-parse.c
+++ b/gdb/mi/mi-parse.c
@@ -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. */
diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c
index c31af8d..32aa5f5 100644
--- a/gdb/mn10300-tdep.c
+++ b/gdb/mn10300-tdep.c
@@ -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)
{
diff --git a/gdb/moxie-tdep.c b/gdb/moxie-tdep.c
index 79d160b..cb04786 100644
--- a/gdb/moxie-tdep.c
+++ b/gdb/moxie-tdep.c
@@ -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)
{
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index d3ff09d..59e129f 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -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)
{
diff --git a/gdb/v850-tdep.c b/gdb/v850-tdep.c
index 16fe825..becb051 100644
--- a/gdb/v850-tdep.c
+++ b/gdb/v850-tdep.c
@@ -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)
{
diff --git a/gdb/xstormy16-tdep.c b/gdb/xstormy16-tdep.c
index cb551ff..99b0c5e 100644
--- a/gdb/xstormy16-tdep.c
+++ b/gdb/xstormy16-tdep.c
@@ -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)
{
--
1.8.1.4
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 1/3] add -Wmissing-parameter-type
2013-06-17 18:42 [PATCH 0/3] add a few new warning options Tom Tromey
@ 2013-06-17 18:42 ` Tom Tromey
2013-06-17 18:42 ` [PATCH 2/3] add -Wold-style-declaration Tom Tromey
` (3 subsequent siblings)
4 siblings, 0 replies; 16+ messages in thread
From: Tom Tromey @ 2013-06-17 18:42 UTC (permalink / raw)
To: gdb-patches; +Cc: Tom Tromey
This adds -Wmissing-parameter-type to gdb's list of warnings.
This one doesn't happen to trigger for a --enable-targets=all build on
x86-64 Fedora 18.
* configure.ac (build_warnings): Add -Wmissing-parameter-type.
* configure: Rebuild.
---
gdb/configure | 2 +-
gdb/configure.ac | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gdb/configure b/gdb/configure
index 383d634..7da2e15 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -12456,7 +12456,7 @@ 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"
+-Wdeclaration-after-statement -Wempty-body -Wmissing-parameter-type"
# Enable -Wno-format by default when using gcc on mingw since many
# GCC versions complain about %I64.
diff --git a/gdb/configure.ac b/gdb/configure.ac
index 46a97bd..f9c04de 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -1929,7 +1929,7 @@ 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"
+-Wdeclaration-after-statement -Wempty-body -Wmissing-parameter-type"
# Enable -Wno-format by default when using gcc on mingw since many
# GCC versions complain about %I64.
--
1.8.1.4
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 0/3] add a few new warning options
@ 2013-06-17 18:42 Tom Tromey
2013-06-17 18:42 ` [PATCH 1/3] add -Wmissing-parameter-type Tom Tromey
` (4 more replies)
0 siblings, 5 replies; 16+ messages in thread
From: Tom Tromey @ 2013-06-17 18:42 UTC (permalink / raw)
To: gdb-patches
I ran across -Wold-style-declaration elsewhere, and this prompted me
to add a few new -W options to gdb's configury.
Nothing too major here, just a few nits; but still worth putting in, I
think.
Some *-nat.c files may need updates. The necessary changes are
trivial, though.
Tom
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH 3/3] add -Wold-style-definition
2013-06-17 18:42 [PATCH 0/3] add a few new warning options Tom Tromey
2013-06-17 18:42 ` [PATCH 1/3] add -Wmissing-parameter-type Tom Tromey
2013-06-17 18:42 ` [PATCH 2/3] add -Wold-style-declaration Tom Tromey
@ 2013-06-17 18:59 ` Tom Tromey
2013-07-02 8:08 ` Build regression on CentOS-5 [Re: [PATCH 3/3] add -Wold-style-definition] Jan Kratochvil
2013-06-18 5:14 ` [PATCH 0/3] add a few new warning options Joel Brobecker
2013-07-01 19:46 ` Tom Tromey
4 siblings, 1 reply; 16+ messages in thread
From: Tom Tromey @ 2013-06-17 18:59 UTC (permalink / raw)
To: gdb-patches; +Cc: Tom Tromey
This adds -Wold-style-definition to gdb's list of warnings. This
found a couple of spots where "()" was used where "(void)" is more
correct.
Tested by rebuilding on x86-64 Fedora 18.
* configure.ac (build_warnings): Add -Wold-style-definition.
* configure: Rebuild.
* machoread.c (_initialize_machoread): Use "(void)".
* macrocmd.c (macro_inform_no_debuginfo): Fix formatting;
use "(void)".
---
gdb/configure | 2 +-
gdb/configure.ac | 2 +-
gdb/machoread.c | 2 +-
gdb/macrocmd.c | 3 ++-
4 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/gdb/configure b/gdb/configure
index 0c9ac97..dcdd496 100755
--- a/gdb/configure
+++ b/gdb/configure
@@ -12457,7 +12457,7 @@ build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \
-Wno-unused -Wunused-value -Wunused-function \
-Wno-switch -Wno-char-subscripts -Wmissing-prototypes \
-Wdeclaration-after-statement -Wempty-body -Wmissing-parameter-type \
--Wold-style-declaration"
+-Wold-style-declaration -Wold-style-definition"
# Enable -Wno-format by default when using gcc on mingw since many
# GCC versions complain about %I64.
diff --git a/gdb/configure.ac b/gdb/configure.ac
index f2cd9dc..811f6f8 100644
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -1930,7 +1930,7 @@ build_warnings="-Wall -Wdeclaration-after-statement -Wpointer-arith \
-Wno-unused -Wunused-value -Wunused-function \
-Wno-switch -Wno-char-subscripts -Wmissing-prototypes \
-Wdeclaration-after-statement -Wempty-body -Wmissing-parameter-type \
--Wold-style-declaration"
+-Wold-style-declaration -Wold-style-definition"
# Enable -Wno-format by default when using gcc on mingw since many
# GCC versions complain about %I64.
diff --git a/gdb/machoread.c b/gdb/machoread.c
index 7a4f0c3..65dd610 100644
--- a/gdb/machoread.c
+++ b/gdb/machoread.c
@@ -1039,7 +1039,7 @@ static const struct sym_fns macho_sym_fns = {
extern initialize_file_ftype _initialize_machoread;
void
-_initialize_machoread ()
+_initialize_machoread (void)
{
add_symtab_fns (&macho_sym_fns);
diff --git a/gdb/macrocmd.c b/gdb/macrocmd.c
index 250a1f0..b48c3c9 100644
--- a/gdb/macrocmd.c
+++ b/gdb/macrocmd.c
@@ -47,7 +47,8 @@ macro_command (char *arg, int from_tty)
/* Prints an informational message regarding the lack of macro information. */
-static void macro_inform_no_debuginfo()
+static void
+macro_inform_no_debuginfo (void)
{
puts_filtered ("GDB has no preprocessor macro information for that code.\n");
}
--
1.8.1.4
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 0/3] add a few new warning options
2013-06-17 18:42 [PATCH 0/3] add a few new warning options Tom Tromey
` (2 preceding siblings ...)
2013-06-17 18:59 ` [PATCH 3/3] add -Wold-style-definition Tom Tromey
@ 2013-06-18 5:14 ` Joel Brobecker
2013-07-01 19:46 ` Tom Tromey
4 siblings, 0 replies; 16+ messages in thread
From: Joel Brobecker @ 2013-06-18 5:14 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches
> I ran across -Wold-style-declaration elsewhere, and this prompted me
> to add a few new -W options to gdb's configury.
>
> Nothing too major here, just a few nits; but still worth putting in, I
> think.
>
> Some *-nat.c files may need updates. The necessary changes are
> trivial, though.
Thanks, Tom. FWIW, I like this warning!
--
Joel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 0/3] add a few new warning options
2013-06-17 18:42 [PATCH 0/3] add a few new warning options Tom Tromey
` (3 preceding siblings ...)
2013-06-18 5:14 ` [PATCH 0/3] add a few new warning options Joel Brobecker
@ 2013-07-01 19:46 ` Tom Tromey
4 siblings, 0 replies; 16+ messages in thread
From: Tom Tromey @ 2013-07-01 19:46 UTC (permalink / raw)
To: gdb-patches
>>>>> "Tom" == Tom Tromey <tromey@redhat.com> writes:
Tom> I ran across -Wold-style-declaration elsewhere, and this prompted me
Tom> to add a few new -W options to gdb's configury.
Tom> Nothing too major here, just a few nits; but still worth putting in, I
Tom> think.
Tom> Some *-nat.c files may need updates. The necessary changes are
Tom> trivial, though.
I'm checking in this series now.
Tom
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH 2/3] add -Wold-style-declaration
2013-06-17 18:42 ` [PATCH 2/3] add -Wold-style-declaration Tom Tromey
@ 2013-07-01 19:49 ` Tom Tromey
0 siblings, 0 replies; 16+ messages in thread
From: Tom Tromey @ 2013-07-01 19:49 UTC (permalink / raw)
To: gdb-patches
>>>>> "Tom" == Tom Tromey <tromey@redhat.com> writes:
Tom> This adds -Wold-style-declaration to gdb's list of warnings.
Tom> It turns out that a few places use "const static" rather than
Tom> "static const". The former is deprecated according to the C standard.
Tom> Tested by rebuilding with --enable-targets=all on x86-64 Fedora 18.
Tom> This misses most of the "nat" code, but any needed fixes are trivial.
Note that I grepped gdb for "const static" and did not find any more
hits. So, probably nothing will be needed.
Tom
^ permalink raw reply [flat|nested] 16+ messages in thread
* Build regression on CentOS-5 [Re: [PATCH 3/3] add -Wold-style-definition]
2013-06-17 18:59 ` [PATCH 3/3] add -Wold-style-definition Tom Tromey
@ 2013-07-02 8:08 ` Jan Kratochvil
2013-07-02 20:53 ` Tom Tromey
0 siblings, 1 reply; 16+ messages in thread
From: Jan Kratochvil @ 2013-07-02 8:08 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches
On Mon, 17 Jun 2013 20:42:52 +0200, Tom Tromey wrote:
> Tested by rebuilding on x86-64 Fedora 18.
On CentOS-5.9-{x86_64,i386} on:
cc1: warnings being treated as errors
In file included from ada-exp.y:770:
ada-lex.c: In function 'yy_get_next_buffer':
ada-lex.c:1444: warning: old-style function definition
ada-lex.c: In function 'yy_get_previous_state':
ada-lex.c:1576: warning: old-style function definition
Regards,
Jan
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Build regression on CentOS-5 [Re: [PATCH 3/3] add -Wold-style-definition]
2013-07-02 8:08 ` Build regression on CentOS-5 [Re: [PATCH 3/3] add -Wold-style-definition] Jan Kratochvil
@ 2013-07-02 20:53 ` Tom Tromey
2013-07-02 20:54 ` Tom Tromey
0 siblings, 1 reply; 16+ messages in thread
From: Tom Tromey @ 2013-07-02 20:53 UTC (permalink / raw)
To: Jan Kratochvil; +Cc: gdb-patches
Jan> cc1: warnings being treated as errors
Jan> In file included from ada-exp.y:770:
Jan> ada-lex.c: In function 'yy_get_next_buffer':
Jan> ada-lex.c:1444: warning: old-style function definition
Jan> ada-lex.c: In function 'yy_get_previous_state':
Jan> ada-lex.c:1576: warning: old-style function definition
Thanks.
As much as I dislike working around old tools, how about the appended?
Tom
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index aca5dbf..a6a6c3e 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -165,6 +165,8 @@ GDB_WERROR_CFLAGS = $(WERROR_CFLAGS)
GDB_WARN_CFLAGS_NO_FORMAT = `echo " $(GDB_WARN_CFLAGS) " \
| sed "s/ -Wformat-nonliteral / -Wno-format-nonliteral /g"`
+GDB_WARN_CFLAGS_NO_DEFS = `echo " $(GDB_WARN_CFLAGS) " \
+ | sed "s/ -Wold-style-definition / /g"`
RDYNAMIC = @RDYNAMIC@
@@ -1580,6 +1582,17 @@ printcmd.o: $(srcdir)/printcmd.c
$(COMPILE.post) $(srcdir)/printcmd.c
$(POSTCOMPILE)
+# ada-exp.c can appear in srcdir, for releases; or in ., for
+# development builds.
+ADA_EXP_C = `if test -f ada-exp.c; then echo ada-exp.c; else echo $(srcdir)/ada-exp.c; fi`
+
+# Some versions of flex give output that triggers
+# -Wold-style-definition.
+ada-exp.o: ada-exp.c
+ $(COMPILE.pre) $(INTERNAL_CFLAGS) $(GDB_WARN_CFLAGS_NO_DEFS) \
+ $(COMPILE.post) $(ADA_EXP_C)
+ $(POSTCOMPILE)
+
# Message files. Based on code in gcc/Makefile.in.
# Rules for generating translated message descriptions. Disabled by
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Build regression on CentOS-5 [Re: [PATCH 3/3] add -Wold-style-definition]
2013-07-02 20:53 ` Tom Tromey
@ 2013-07-02 20:54 ` Tom Tromey
2013-07-03 9:00 ` Jan Kratochvil
2013-07-10 16:51 ` Michael Eager
0 siblings, 2 replies; 16+ messages in thread
From: Tom Tromey @ 2013-07-02 20:54 UTC (permalink / raw)
To: Jan Kratochvil; +Cc: gdb-patches
Tom> As much as I dislike working around old tools, how about the appended?
Grr, wrong version.
Tom
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index aca5dbf..7f6e7b6 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -165,6 +165,8 @@ GDB_WERROR_CFLAGS = $(WERROR_CFLAGS)
GDB_WARN_CFLAGS_NO_FORMAT = `echo " $(GDB_WARN_CFLAGS) " \
| sed "s/ -Wformat-nonliteral / -Wno-format-nonliteral /g"`
+GDB_WARN_CFLAGS_NO_DEFS = `echo " $(GDB_WARN_CFLAGS) " \
+ | sed "s/ -Wold-style-definition / -Wno-old-style-definition /g"`
RDYNAMIC = @RDYNAMIC@
@@ -1580,6 +1582,17 @@ printcmd.o: $(srcdir)/printcmd.c
$(COMPILE.post) $(srcdir)/printcmd.c
$(POSTCOMPILE)
+# ada-exp.c can appear in srcdir, for releases; or in ., for
+# development builds.
+ADA_EXP_C = `if test -f ada-exp.c; then echo ada-exp.c; else echo $(srcdir)/ada-exp.c; fi`
+
+# Some versions of flex give output that triggers
+# -Wold-style-definition.
+ada-exp.o: ada-exp.c
+ $(COMPILE.pre) $(INTERNAL_CFLAGS) $(GDB_WARN_CFLAGS_NO_DEFS) \
+ $(COMPILE.post) $(ADA_EXP_C)
+ $(POSTCOMPILE)
+
# Message files. Based on code in gcc/Makefile.in.
# Rules for generating translated message descriptions. Disabled by
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Build regression on CentOS-5 [Re: [PATCH 3/3] add -Wold-style-definition]
2013-07-02 20:54 ` Tom Tromey
@ 2013-07-03 9:00 ` Jan Kratochvil
2013-07-10 16:28 ` Tom Tromey
2013-07-10 16:51 ` Michael Eager
1 sibling, 1 reply; 16+ messages in thread
From: Jan Kratochvil @ 2013-07-03 9:00 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches
On Tue, 02 Jul 2013 22:54:05 +0200, Tom Tromey wrote:
> @@ -1580,6 +1582,17 @@ printcmd.o: $(srcdir)/printcmd.c
> $(COMPILE.post) $(srcdir)/printcmd.c
> $(POSTCOMPILE)
>
> +# ada-exp.c can appear in srcdir, for releases; or in ., for
> +# development builds.
> +ADA_EXP_C = `if test -f ada-exp.c; then echo ada-exp.c; else echo $(srcdir)/ada-exp.c; fi`
> +
> +# Some versions of flex give output that triggers
> +# -Wold-style-definition.
> +ada-exp.o: ada-exp.c
> + $(COMPILE.pre) $(INTERNAL_CFLAGS) $(GDB_WARN_CFLAGS_NO_DEFS) \
> + $(COMPILE.post) $(ADA_EXP_C)
I would find easier: s/$(ADA_EXP_C)/$</ and remove ADA_EXP_C = above.
Or is that for non-GNU make without VPATH? But non-VPATH make would IMO fail
on missing pre-requisite file ada-exp.c.
I do not mind either way.
> + $(POSTCOMPILE)
> +
> # Message files. Based on code in gcc/Makefile.in.
>
> # Rules for generating translated message descriptions. Disabled by
Thanks,
Jan
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Build regression on CentOS-5 [Re: [PATCH 3/3] add -Wold-style-definition]
2013-07-03 9:00 ` Jan Kratochvil
@ 2013-07-10 16:28 ` Tom Tromey
0 siblings, 0 replies; 16+ messages in thread
From: Tom Tromey @ 2013-07-10 16:28 UTC (permalink / raw)
To: Jan Kratochvil; +Cc: gdb-patches
>>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:
Jan> I would find easier: s/$(ADA_EXP_C)/$</ and remove ADA_EXP_C =
Jan> above. Or is that for non-GNU make without VPATH? But non-VPATH
Jan> make would IMO fail on missing pre-requisite file ada-exp.c.
Jan> I do not mind either way.
I think that according to POSIX, $< is unspecified in an explicit rule.
I think we ought to fully require GNU make but this patch isn't the way
to decide that :)
Tom
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Build regression on CentOS-5 [Re: [PATCH 3/3] add -Wold-style-definition]
2013-07-02 20:54 ` Tom Tromey
2013-07-03 9:00 ` Jan Kratochvil
@ 2013-07-10 16:51 ` Michael Eager
2013-07-10 18:11 ` Tom Tromey
1 sibling, 1 reply; 16+ messages in thread
From: Michael Eager @ 2013-07-10 16:51 UTC (permalink / raw)
To: Tom Tromey; +Cc: gdb-patches
On 07/02/13 13:54, Tom Tromey wrote:
> Tom> As much as I dislike working around old tools, how about the appended?
>
> Grr, wrong version.
>
> Tom
>
> diff --git a/gdb/Makefile.in b/gdb/Makefile.in
> index aca5dbf..7f6e7b6 100644
> --- a/gdb/Makefile.in
> +++ b/gdb/Makefile.in
> @@ -165,6 +165,8 @@ GDB_WERROR_CFLAGS = $(WERROR_CFLAGS)
>
> GDB_WARN_CFLAGS_NO_FORMAT = `echo " $(GDB_WARN_CFLAGS) " \
> | sed "s/ -Wformat-nonliteral / -Wno-format-nonliteral /g"`
> +GDB_WARN_CFLAGS_NO_DEFS = `echo " $(GDB_WARN_CFLAGS) " \
> + | sed "s/ -Wold-style-definition / -Wno-old-style-definition /g"`
>
> RDYNAMIC = @RDYNAMIC@
>
> @@ -1580,6 +1582,17 @@ printcmd.o: $(srcdir)/printcmd.c
> $(COMPILE.post) $(srcdir)/printcmd.c
> $(POSTCOMPILE)
>
> +# ada-exp.c can appear in srcdir, for releases; or in ., for
> +# development builds.
> +ADA_EXP_C = `if test -f ada-exp.c; then echo ada-exp.c; else echo $(srcdir)/ada-exp.c; fi`
> +
> +# Some versions of flex give output that triggers
> +# -Wold-style-definition.
> +ada-exp.o: ada-exp.c
> + $(COMPILE.pre) $(INTERNAL_CFLAGS) $(GDB_WARN_CFLAGS_NO_DEFS) \
> + $(COMPILE.post) $(ADA_EXP_C)
> + $(POSTCOMPILE)
> +
> # Message files. Based on code in gcc/Makefile.in.
>
> # Rules for generating translated message descriptions. Disabled by
Are you going to check in the fix for this regression?
--
Michael Eager eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306 650-325-8077
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Build regression on CentOS-5 [Re: [PATCH 3/3] add -Wold-style-definition]
2013-07-10 16:51 ` Michael Eager
@ 2013-07-10 18:11 ` Tom Tromey
2013-07-10 18:24 ` Joel Brobecker
0 siblings, 1 reply; 16+ messages in thread
From: Tom Tromey @ 2013-07-10 18:11 UTC (permalink / raw)
To: Michael Eager; +Cc: gdb-patches
Michael> Are you going to check in the fix for this regression?
Yeah, I'll do it now.
I'm partly of the opinion that folks with very old versions of developer
tools should either disable the warnings or upgrade their tools.
Otherwise we're letting bad versions of flex, etc, hold things back.
Tom
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Build regression on CentOS-5 [Re: [PATCH 3/3] add -Wold-style-definition]
2013-07-10 18:11 ` Tom Tromey
@ 2013-07-10 18:24 ` Joel Brobecker
2013-07-10 19:11 ` Michael Eager
0 siblings, 1 reply; 16+ messages in thread
From: Joel Brobecker @ 2013-07-10 18:24 UTC (permalink / raw)
To: Tom Tromey; +Cc: Michael Eager, gdb-patches
> I'm partly of the opinion that folks with very old versions of developer
> tools should either disable the warnings or upgrade their tools.
> Otherwise we're letting bad versions of flex, etc, hold things back.
FWIW, I agree.
--
Joel
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: Build regression on CentOS-5 [Re: [PATCH 3/3] add -Wold-style-definition]
2013-07-10 18:24 ` Joel Brobecker
@ 2013-07-10 19:11 ` Michael Eager
0 siblings, 0 replies; 16+ messages in thread
From: Michael Eager @ 2013-07-10 19:11 UTC (permalink / raw)
To: Joel Brobecker; +Cc: Tom Tromey, gdb-patches
On 07/10/13 11:24, Joel Brobecker wrote:
>> I'm partly of the opinion that folks with very old versions of developer
>> tools should either disable the warnings or upgrade their tools.
>> Otherwise we're letting bad versions of flex, etc, hold things back.
>
> FWIW, I agree.
Yes, me too. Fine with me if you don't apply the patch.
I'm working on a system which has flex-2.5.4 installed, which
seems to data from 1997. I'll build a local version.
--
Michael Eager eager@eagercon.com
1960 Park Blvd., Palo Alto, CA 94306 650-325-8077
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2013-07-10 19:11 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-17 18:42 [PATCH 0/3] add a few new warning options Tom Tromey
2013-06-17 18:42 ` [PATCH 1/3] add -Wmissing-parameter-type Tom Tromey
2013-06-17 18:42 ` [PATCH 2/3] add -Wold-style-declaration Tom Tromey
2013-07-01 19:49 ` Tom Tromey
2013-06-17 18:59 ` [PATCH 3/3] add -Wold-style-definition Tom Tromey
2013-07-02 8:08 ` Build regression on CentOS-5 [Re: [PATCH 3/3] add -Wold-style-definition] Jan Kratochvil
2013-07-02 20:53 ` Tom Tromey
2013-07-02 20:54 ` Tom Tromey
2013-07-03 9:00 ` Jan Kratochvil
2013-07-10 16:28 ` Tom Tromey
2013-07-10 16:51 ` Michael Eager
2013-07-10 18:11 ` Tom Tromey
2013-07-10 18:24 ` Joel Brobecker
2013-07-10 19:11 ` Michael Eager
2013-06-18 5:14 ` [PATCH 0/3] add a few new warning options Joel Brobecker
2013-07-01 19:46 ` Tom Tromey
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox