From: Mike Frysinger <vapier@gentoo.org>
To: gdb-patches@sourceware.org
Subject: [PATCH] gdb: constify remote files_info
Date: Sat, 10 Apr 2010 20:52:00 -0000 [thread overview]
Message-ID: <1270932710-24968-1-git-send-email-vapier@gentoo.org> (raw)
The sim and m32r remote targets declare a local "file" variable and only
assign const strings to it before passing it to a printf() func. So add
const markings to avoid gcc warnings like:
gdb/remote-sim.c: In function 'gdbsim_files_info':
gdb/remote-sim.c:789: warning: initialization discards qualifiers
from pointer target type
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
2010-04-10 Mike Frysinger <vapier@gentoo.org>
* remote-m32r-sdi.c (m32r_files_info): Add const to local "file" var.
* remote-sim.c (gdbsim_files_info): Likewise.
gdb/remote-m32r-sdi.c | 2 +-
gdb/remote-sim.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/gdb/remote-m32r-sdi.c b/gdb/remote-m32r-sdi.c
index be6a564..a74075b 100644
--- a/gdb/remote-m32r-sdi.c
+++ b/gdb/remote-m32r-sdi.c
@@ -1020,7 +1020,7 @@ m32r_prepare_to_store (struct regcache *regcache)
static void
m32r_files_info (struct target_ops *target)
{
- char *file = "nothing";
+ const char *file = "nothing";
if (exec_bfd)
{
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index 9f1adc7..53f3109 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -793,7 +793,7 @@ gdbsim_xfer_inferior_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len,
static void
gdbsim_files_info (struct target_ops *target)
{
- char *file = "nothing";
+ const char *file = "nothing";
if (exec_bfd)
file = bfd_get_filename (exec_bfd);
--
1.7.0.2
next reply other threads:[~2010-04-10 20:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-10 20:52 Mike Frysinger [this message]
2010-04-12 15:00 ` Joel Brobecker
2010-04-10 21:58 Mike Frysinger
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=1270932710-24968-1-git-send-email-vapier@gentoo.org \
--to=vapier@gentoo.org \
--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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).