Fix remote-sim.c build after warn-unused-result change

John Darrington pointed out that commit 18cb7c9f3 ("Introduce
ATTRIBUTE_UNUSED_RESULT and use it") broke the build:

/home/john/binutils-gdb/gdb/remote-sim.c: In function 'void gdbsim_target_open(const char*, int)':
/home/john/binutils-gdb/gdb/remote-sim.c:765:18: error: ignoring return value of 'char** gdb_argv::release()', declared with attribute warn_unused_result [-Werror=unused-result]

This patch fixes the problem by arranging to use the result of the
release method.

Tested by rebuilding with a simulator enabled.

gdb/ChangeLog
2019-03-06  Tom Tromey  <tromey@adacore.com>

	* remote-sim.c (gdbsim_target_open): Use result of
	gdb_argv::release.
This commit is contained in:
Tom Tromey 2019-03-06 07:55:42 -07:00
parent c3734e093a
commit 67a3048c0f
2 changed files with 7 additions and 3 deletions

View File

@ -1,3 +1,8 @@
2019-03-06 Tom Tromey <tromey@adacore.com>
* remote-sim.c (gdbsim_target_open): Use result of
gdb_argv::release.
2019-03-06 Richard Bunt <richard.bunt@arm.com>
Dirk Schubert <dirk.schubert@arm.com>
Chris January <chris.january@arm.com>

View File

@ -751,19 +751,18 @@ gdbsim_target_open (const char *args, int from_tty)
}
gdb_argv argv (arg_buf);
sim_argv = argv.get ();
sim_argv = argv.release ();
init_callbacks ();
gdbsim_desc = sim_open (SIM_OPEN_DEBUG, &gdb_callback, exec_bfd, sim_argv);
if (gdbsim_desc == 0)
{
freeargv (sim_argv);
sim_argv = NULL;
error (_("unable to create simulator instance"));
}
argv.release ();
/* Reset the pid numberings for this batch of sim instances. */
next_pid = INITIAL_PID;