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] sim: add const markings to env string


The sim-options code assigns a const string to "char *" in decoding the 
current environment settings, and only uses it to pass to a printf.  GCC 
outputs the warnings:
common/sim-options.c: In function 'standard_option_handler':
common/sim-options.c:271: warning: assignment discards qualifiers from pointer 
target type
common/sim-options.c:272: warning: assignment discards qualifiers from pointer 
target type
common/sim-options.c:273: warning: assignment discards qualifiers from pointer 
target type

So I've committed this as "obvious".
-mike

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

	* sim-options.c (standard_option_handler): Add const markings to
	local "type" var.

RCS file: /cvs/src/src/sim/common/sim-options.c,v
retrieving revision 1.16
diff -u -p -r1.16 sim-options.c
--- sim/common/sim-options.c	30 Mar 2010 19:43:42 -0000	1.16
+++ sim/common/sim-options.c	10 Apr 2010 07:32:19 -0000
@@ -265,7 +265,7 @@ standard_option_handler (SIM_DESC sd, si
       if (WITH_ENVIRONMENT != ALL_ENVIRONMENT
 	  && WITH_ENVIRONMENT != STATE_ENVIRONMENT (sd))
 	{
-	  char *type;
+	  const char *type;
 	  switch (WITH_ENVIRONMENT)
 	    {
 	    case USER_ENVIRONMENT: type = "user"; break;

Attachment: signature.asc
Description: This is a digitally signed message part.


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