aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>1998-02-28 03:01:51 +0000
committerAndrew Cagney <cagney@redhat.com>1998-02-28 03:01:51 +0000
commitbaf8377df80da5799c89496da1580703863858e1 (patch)
tree734b5ac4d37698f894a532ab5d8cda3ba284583c
parent0e701ac37b0154048977636afe262f55a9150492 (diff)
downloadgdb-baf8377df80da5799c89496da1580703863858e1.zip
gdb-baf8377df80da5799c89496da1580703863858e1.tar.gz
gdb-baf8377df80da5799c89496da1580703863858e1.tar.bz2
Pacify GCC: const char * passed to asprintf; int function returning
void; unused variable.
-rw-r--r--sim/common/ChangeLog9
-rw-r--r--sim/common/sim-module.c2
-rw-r--r--sim/common/sim-options.c7
3 files changed, 14 insertions, 4 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog
index e362e28..dc11d98 100644
--- a/sim/common/ChangeLog
+++ b/sim/common/ChangeLog
@@ -1,3 +1,12 @@
+Sat Feb 28 13:54:10 1998 Andrew Cagney <cagney@b1.cygnus.com>
+
+ * sim-module.c (sim_pre_argv_init): String passed to asprintf
+ can't be constant.
+
+ * sim-options.c (sim_parse_args): Ditto.
+ (sim_args_command): Return OK, instead of nothing, for an empty
+ command.
+
Fri Feb 27 13:29:13 1998 Andrew Cagney <cagney@b1.cygnus.com>
* sim-profile.c (profile_info): Rename from profile_print. Drop
diff --git a/sim/common/sim-module.c b/sim/common/sim-module.c
index bb1dca4..c3a92ce 100644
--- a/sim/common/sim-module.c
+++ b/sim/common/sim-module.c
@@ -81,7 +81,7 @@ sim_pre_argv_init (SIM_DESC sd, const char *myname)
int i;
for (i = 0; i < MAX_NR_PROCESSORS; ++i)
{
- const char *name;
+ char *name;
asprintf (&name, "cpu%d", i);
CPU_NAME (STATE_CPU (sd, i)) = name;
}
diff --git a/sim/common/sim-options.c b/sim/common/sim-options.c
index ca38af5..e94f9aa 100644
--- a/sim/common/sim-options.c
+++ b/sim/common/sim-options.c
@@ -553,9 +553,11 @@ sim_parse_args (sd, argv)
}
if (opt->opt.name != NULL)
{
+ char *name;
*lp = opt->opt;
/* Prepend --<cpuname>- to the option. */
- asprintf (&lp->name, "%s-%s", CPU_NAME (cpu), lp->name);
+ asprintf (&name, "%s-%s", CPU_NAME (cpu), lp->name);
+ lp->name = name;
/* Dynamically assign `val' numbers for long options. */
lp->val = i++;
handlers[lp->val] = opt->handler;
@@ -851,10 +853,9 @@ sim_args_command (SIM_DESC sd, char *cmd)
const OPTION *matching_opt = NULL;
int matching_argi;
sim_cpu *cpu;
- int argi = 0;
if (argv [0] == NULL)
- return;
+ return SIM_RC_OK; /* FIXME - perhaphs help would be better */
/* First check for a cpu selector. */
{