fbsd-nat: Pacify gcc with no functional changes
I see these errors on FreeBSD/aarch64 when using gcc 12 without passing
--disable-werror.
=====================================================================
CXX fbsd-nat.o
fbsd-nat.c: In member function 'void fbsd_nat_target::resume_one_process(ptid_t, int, gdb_signal)':
fbsd-nat.c:1208:11: error: unused variable 'request' [-Werror=unused-variable]
1208 | int request;
| ^~~~~~~
fbsd-nat.c: In member function 'virtual ptid_t fbsd_nat_target::wait(ptid_t, target_waitstatus*, target_wait_flags)':
fbsd-nat.c:1726:22: error: declaration of 'inf' shadows a previous local [-Werror=shadow=compatible-local]
1726 | for (inferior *inf : all_non_exited_inferiors (this))
| ^~~
fbsd-nat.c:1697:17: note: shadowed declaration is here
1697 | inferior *inf = find_inferior_ptid (this, wptid);
| ^~~
fbsd-nat.c: In member function 'virtual void fbsd_nat_target::detach(inferior*, int)':
fbsd-nat.c:2044:18: error: variable 'wptid' set but not used [-Werror=unused-but-set-variable]
2044 | ptid_t wptid = wait_1 (ptid, &ws, 0);
| ^~~~~
cc1plus: all warnings being treated as errors
=====================================================================
This patch includes the following non-functional changes,
1. Remove unused variable "request".
2. Rename inf to inf_p to avoid shadowed declaration warnings.
3. Mark wptid as used when USE_SIGTRAP_SIGINFO is defined.
Tested on FreeBSD/aarch64 by rebuilding.
Approved-By: John Baldwin <jhb@FreeBSD.org>