* [patch] sim: add const markings to env string
@ 2010-04-10 7:57 Mike Frysinger
0 siblings, 0 replies; only message in thread
From: Mike Frysinger @ 2010-04-10 7:57 UTC (permalink / raw)
To: gdb-patches
[-- Attachment #1: Type: text/plain, Size: 1233 bytes --]
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 #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-04-10 7:57 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-10 7:57 [patch] sim: add const markings to env string Mike Frysinger
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).