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]

[PATCH] gdb: constify remote files_info


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


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