Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Subject: gnu-nat.c, compile it without -Werror
Date: Tue, 09 Sep 2008 15:26:00 -0000	[thread overview]
Message-ID: <200809091626.06394.pedro@codesourcery.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 492 bytes --]

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

[-- Attachment #2: hurd_werror.diff --]
[-- Type: text/x-diff, Size: 955 bytes --]

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

             reply	other threads:[~2008-09-09 15:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-09 15:26 Pedro Alves [this message]
2008-09-09 15:33 ` Alfred M. Szmidt
2008-09-10 17:41 ` Joel Brobecker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200809091626.06394.pedro@codesourcery.com \
    --to=pedro@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox