[patch] sim: constify save_data()

Mike Frysinger vapier@gentoo.org
Sat Apr 10 07:57:00 GMT 2010


The local save_data() function takes a pointer to a buffer and only uses it as 
the source to the memcpy() function.  Since it is given const strings, GCC 
likes to spit out warnings:
common/sim-trace.c: In function 'trace_prefix':
common/sim-trace.c:697: warning: passing argument 5 of 'save_data' discards 
qualifiers from pointer target type

So I've committed this as obvious.
-mike

2010-04-10  Mike Frysinger  <vapier@gentoo.org>

	* sim-trace.c (save_data): Add const markings to "buf" argument.

RCS file: /cvs/src/src/sim/common/sim-trace.c,v
retrieving revision 1.10
diff -u -p -r1.10 sim-trace.c
--- sim/common/sim-trace.c	30 Mar 2010 20:39:38 -0000	1.10
+++ sim/common/sim-trace.c	10 Apr 2010 07:53:43 -0000
@@ -513,7 +513,7 @@ save_data (SIM_DESC sd,
 	   TRACE_DATA *data,
 	   data_fmt fmt,
 	   long size,
-	   void *buf)
+	   const void *buf)
 {
   int i = TRACE_INPUT_IDX (data);
   if (i == sizeof (TRACE_INPUT_FMT (data)))
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20100410/a971bf34/attachment.sig>


More information about the Gdb-patches mailing list