From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org, Joel Brobecker <brobecker@adacore.com>
Subject: Re: [commit] Build memmem with -Wno-error.
Date: Tue, 31 Aug 2010 20:15:00 -0000 [thread overview]
Message-ID: <20100831201455.GA24500@host1.dyn.jankratochvil.net> (raw)
In-Reply-To: <201008312048.35034.pedro@codesourcery.com>
On Tue, 31 Aug 2010 21:48:34 +0200, Pedro Alves wrote:
> It would be better to come up with
> an $(INTERNAL_CFLAGS) variant that does not include -Werror in the first
> place, and use that instead in the memmem.o rule. gdb/Makefile.in uses
> INTERNAL_WARN_CFLAGS for exactly that. I suggest to do the same here. Take
> a look at the monitor.o rule in gdb/Makefile.in.
This is a longterm cosmetic problem. Anytime I modify anything in defs.h VIM
jumps to the warnings in monitor.c which I have to skip.
There should be the explicit -Wno-format-nonliteral form. Just removing
-Wformat-nonliteral or -Werror is not enough.
Combined the patch together with making it more restrictive. It should no
longer be IMO such a concern since Joel started removing -Werror for releases.
Tested compilation on x86_64-fedora14snapshot-linux-gnu.
Thanks,
Jan
gdb/
2010-08-31 Jan Kratochvil <jan.kratochvil@redhat.com>
* Makefile.in (GDB_WARN_CFLAGS_NO_FORMAT): Convert it to the no- form.
(monitor.o): Replace $(INTERNAL_WARN_CFLAGS) by $(INTERNAL_CFLAGS) and
add $(GDB_WARN_CFLAGS_NO_FORMAT).
(printcmd.o): Replace $(INTERNAL_CFLAGS_BASE) by $(INTERNAL_CFLAGS).
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -155,7 +155,8 @@ WERROR_CFLAGS = @WERROR_CFLAGS@
GDB_WARN_CFLAGS = $(WARN_CFLAGS)
GDB_WERROR_CFLAGS = $(WERROR_CFLAGS)
-GDB_WARN_CFLAGS_NO_FORMAT = `echo " $(GDB_WARN_CFLAGS) " | sed "s/ -Wformat-nonliteral / /g"`
+GDB_WARN_CFLAGS_NO_FORMAT = `echo " $(GDB_WARN_CFLAGS) " \
+ | sed "s/ -Wformat-nonliteral / -Wno-format-nonliteral /g"`
RDYNAMIC = @RDYNAMIC@
@@ -1531,14 +1532,15 @@ main.o: $(srcdir)/main.c
# definitly will not work. "monitor.c" needs to be rewritten so that
# it doesn't use format strings and instead uses callbacks.
monitor.o: $(srcdir)/monitor.c
- $(COMPILE.pre) $(INTERNAL_WARN_CFLAGS) $(COMPILE.post) $(srcdir)/monitor.c
+ $(COMPILE.pre) $(INTERNAL_CFLAGS) $(GDB_WARN_CFLAGS_NO_FORMAT) \
+ $(COMPILE.post) $(srcdir)/monitor.c
$(POSTCOMPILE)
# Do not try to build "printcmd.c" with -Wformat-nonliteral. It manually
# checks format strings.
printcmd.o: $(srcdir)/printcmd.c
- $(COMPILE.pre) $(INTERNAL_CFLAGS_BASE) $(GDB_WARN_CFLAGS_NO_FORMAT) \
- $(GDB_WERROR_CFLAGS) $(COMPILE.post) $(srcdir)/printcmd.c
+ $(COMPILE.pre) $(INTERNAL_CFLAGS) $(GDB_WARN_CFLAGS_NO_FORMAT) \
+ $(COMPILE.post) $(srcdir)/printcmd.c
$(POSTCOMPILE)
# Message files. Based on code in gcc/Makefile.in.
next prev parent reply other threads:[~2010-08-31 20:15 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-31 19:08 Joel Brobecker
2010-08-31 19:48 ` Pedro Alves
2010-08-31 20:15 ` Jan Kratochvil [this message]
2010-08-31 20:34 ` Pedro Alves
2010-08-31 21:22 ` Joel Brobecker
2010-08-31 21:59 ` Pedro Alves
2010-08-31 22:07 ` Joel Brobecker
2010-08-31 22:13 ` Jan Kratochvil
2010-08-31 22:21 ` Pedro Alves
2010-09-02 14:54 ` Jan Kratochvil
2010-08-31 22:04 ` Joel Brobecker
2010-08-31 22:23 ` Pedro Alves
2010-09-01 1:56 ` 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=20100831201455.GA24500@host1.dyn.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=brobecker@adacore.com \
--cc=gdb-patches@sourceware.org \
--cc=pedro@codesourcery.com \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).