sim: add const markings to env string
authorMike Frysinger <vapier@gentoo.org>
Sat, 10 Apr 2010 07:35:35 +0000 (07:35 +0000)
committerMike Frysinger <vapier@gentoo.org>
Sat, 10 Apr 2010 07:35:35 +0000 (07:35 +0000)
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".

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
sim/common/ChangeLog
sim/common/sim-options.c

index f3212a1bc4bbaf1696b1751f4ad0372e4744264e..f360dee64e15d75203b32814110758eabe3dbedd 100644 (file)
@@ -1,3 +1,8 @@
+2010-04-10  Mike Frysinger  <vapier@gentoo.org>
+
+       * sim-options.c (standard_option_handler): Add const markings to
+       local "type" var.
+
 2010-04-02  Mike Frysinger  <vapier@gentoo.org>
 
        * hw-ports.h: Fix spelling typos.
index 571b29213bdd6d5d8bc9334ff5cb2f673f72c3e3..a37dca9a4cc3d29c6b134b65c2a743b740b744c8 100644 (file)
@@ -265,7 +265,7 @@ standard_option_handler (SIM_DESC sd, sim_cpu *cpu, int opt,
       if (WITH_ENVIRONMENT != ALL_ENVIRONMENT
          && WITH_ENVIRONMENT != STATE_ENVIRONMENT (sd))
        {
-         char *type;
+         const char *type;
          switch (WITH_ENVIRONMENT)
            {
            case USER_ENVIRONMENT: type = "user"; break;