This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

gnu-nat.c, compile it without -Werror


Building gnu-nat.c fails with:

../../src/gdb/gnu-nat.c: In function 'inf_set_traced':
../../src/gdb/gnu-nat.c:884: error: suggest parentheses around assignment used 
as truth value
../../src/gdb/gnu-nat.c:884: error: suggest parentheses around assignment used 
as truth value
../../src/gdb/gnu-nat.c: In function 'inf_signal':
(... a few more instances of the same ...)

Turns out that warning comes from the definition of HURD_MSGPORT_RPC,
a 20+ lines system macro...

OK?

-- 
Pedro Alves
2008-09-09  Pedro Alves  <pedro@codesourcery.com>

	* Makefile.in (gnu-nat.o): New rule.

---
 gdb/Makefile.in |    7 +++++++
 1 file changed, 7 insertions(+)

Index: src/gdb/Makefile.in
===================================================================
--- src.orig/gdb/Makefile.in	2008-09-09 16:18:48.000000000 +0100
+++ src/gdb/Makefile.in	2008-09-09 16:23:30.000000000 +0100
@@ -1363,6 +1363,13 @@ monitor.o: $(srcdir)/monitor.c
 	$(COMPILE.pre) $(INTERNAL_WARN_CFLAGS) $(COMPILE.post) $(srcdir)/monitor.c
 	$(POSTCOMPILE)
 
+# "gnu-nat.c" gets "suggest parentheses around assignment used as
+# truth value" errors.  It turns out that there is a system header
+# that does `if (a = b)'.
+gnu-nat.o: $(srcdir)/gnu-nat.c
+	$(COMPILE.pre) $(INTERNAL_WARN_CFLAGS) $(COMPILE.post) $(srcdir)/gnu-nat.c
+	$(POSTCOMPILE)
+
 # Do not try to build "printcmd.c" with -Wformat-nonliteral.  It manually
 # checks format strings.
 printcmd.o: $(srcdir)/printcmd.c

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]