This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[gdb] fix build error in remote-sim.c
- From: "Greta Yorsh" <Greta dot Yorsh at arm dot com>
- To: <gdb-patches at sourceware dot org>
- Cc: <brobecker at adacore dot com>
- Date: Mon, 18 Jun 2012 16:26:23 +0100
- Subject: [gdb] fix build error in remote-sim.c
Build fails with the following message:
src/binutils/gdb/remote-sim.c:1207: error: 'result' may be used
uninitialized in this function.
This patch adds missing initialization.
Thanks,
Greta
Changelog
gdb/
2012-06-18 Greta Yorsh <Greta.Yorsh@arm.com>
* remote-sim.c (sim_command_completer): Initialize
variable 'result'.
diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c
index 11e1003..f5927f2 100644
--- a/gdb/remote-sim.c
+++ b/gdb/remote-sim.c
@@ -1204,7 +1204,7 @@ sim_command_completer (struct cmd_list_element
*ignore, char *text, char *word)
struct sim_inferior_data *sim_data;
char **tmp;
int i;
- VEC (char_ptr) *result;
+ VEC (char_ptr) *result = NULL;
sim_data = inferior_data (current_inferior (), sim_inferior_data_key);
if (sim_data == NULL || sim_data->gdbsim_desc == NULL)