On x86_64-linux, with gcc 7.5.0 I ran into a build breaker:
...
linux-fork.c: In function ‘void detach_checkpoint_command(const char*, int)’:
linux-fork.c:744:16: error: unused variable ‘inf’ [-Werror=unused-variable]
auto [fi, inf] = parse_checkpoint_id (args);
^
linux-fork.c: In function ‘void linux_fork_context(fork_info*, int, inferior*)’:
linux-fork.c:1020:22: error: unused variable ‘oldinf’ [-Werror=unused-variable]
auto [oldfp, oldinf] = find_fork_ptid (inferior_ptid);
^
...
Fix this by dropping the unused variables, similar how that was done in commit
bc13da1980c ("[gdb/build] Fix unused var in corelow.c").
Tested on x86_64-linux, by completing a build.
if (!args || !*args)
error (_("Requires argument (checkpoint id to detach)"));
- auto [fi, inf] = parse_checkpoint_id (args);
+ auto fi = parse_checkpoint_id (args).first;
ptid = fi->ptid;
if (ptid == inferior_ptid)
inferior_changed = true;
}
- auto [oldfp, oldinf] = find_fork_ptid (inferior_ptid);
+ auto oldfp = find_fork_ptid (inferior_ptid).first;
gdb_assert (oldfp != NULL);
if (oldfp != newfp)