Message ID | 1500395194-21455-5-git-send-email-peter.maydell@linaro.org |
---|---|
State | Accepted |
Commit | e4335180d2b40de8a5027030edbcd89aa6557bbc |
Headers | show |
Series | bsd-user: silence warnings on OpenBSD | expand |
On 07/18/2017 11:26 AM, Peter Maydell wrote: > On OpenBSD the compiler warns: > bsd-user/main.c:622:21: warning: variable 'sig' set but not used [-Wunused-but-set-variable] > > This is because a lot of the signal delivery code is #if-0'd > out as unused. Reshuffle #ifdefs a bit to silence the warning. Why not just nuke the #if 0 code instead (we can always 'git revert' it later as a starting point for someone that wants to implement it). -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
On 18 July 2017 at 23:01, Eric Blake <eblake@redhat.com> wrote: > On 07/18/2017 11:26 AM, Peter Maydell wrote: >> On OpenBSD the compiler warns: >> bsd-user/main.c:622:21: warning: variable 'sig' set but not used [-Wunused-but-set-variable] >> >> This is because a lot of the signal delivery code is #if-0'd >> out as unused. Reshuffle #ifdefs a bit to silence the warning. > > Why not just nuke the #if 0 code instead (we can always 'git revert' it > later as a starting point for someone that wants to implement it). I went for the minimal change, especially given we know that the freebsd folks have a big patchset on top of us fixing a lot of bsd-user code and it didn't seem worth giving them a more awkward rebase task. thanks -- PMM
On 19.07.2017 10:19, Peter Maydell wrote: > On 18 July 2017 at 23:01, Eric Blake <eblake@redhat.com> wrote: >> On 07/18/2017 11:26 AM, Peter Maydell wrote: >>> On OpenBSD the compiler warns: >>> bsd-user/main.c:622:21: warning: variable 'sig' set but not used [-Wunused-but-set-variable] >>> >>> This is because a lot of the signal delivery code is #if-0'd >>> out as unused. Reshuffle #ifdefs a bit to silence the warning. >> >> Why not just nuke the #if 0 code instead (we can always 'git revert' it >> later as a starting point for someone that wants to implement it). > > I went for the minimal change, especially given we know > that the freebsd folks have a big patchset on top of > us fixing a lot of bsd-user code and it didn't seem worth > giving them a more awkward rebase task. That's fair. So FWIW: Reviewed-by: Thomas Huth <thuth@redhat.com>
On 07/19/2017 03:19 AM, Peter Maydell wrote: > On 18 July 2017 at 23:01, Eric Blake <eblake@redhat.com> wrote: >> On 07/18/2017 11:26 AM, Peter Maydell wrote: >>> On OpenBSD the compiler warns: >>> bsd-user/main.c:622:21: warning: variable 'sig' set but not used [-Wunused-but-set-variable] >>> >>> This is because a lot of the signal delivery code is #if-0'd >>> out as unused. Reshuffle #ifdefs a bit to silence the warning. >> >> Why not just nuke the #if 0 code instead (we can always 'git revert' it >> later as a starting point for someone that wants to implement it). > > I went for the minimal change, especially given we know > that the freebsd folks have a big patchset on top of > us fixing a lot of bsd-user code and it didn't seem worth > giving them a more awkward rebase task. Perhaps worth mentioning in the commit message that keeping the #if 0 is intentional, then. At any rate, Reviewed-by: Eric Blake <eblake@redhat.com> -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
On 21 July 2017 at 13:23, Eric Blake <eblake@redhat.com> wrote: > On 07/19/2017 03:19 AM, Peter Maydell wrote: >> On 18 July 2017 at 23:01, Eric Blake <eblake@redhat.com> wrote: >>> On 07/18/2017 11:26 AM, Peter Maydell wrote: >>>> On OpenBSD the compiler warns: >>>> bsd-user/main.c:622:21: warning: variable 'sig' set but not used [-Wunused-but-set-variable] >>>> >>>> This is because a lot of the signal delivery code is #if-0'd >>>> out as unused. Reshuffle #ifdefs a bit to silence the warning. >>> >>> Why not just nuke the #if 0 code instead (we can always 'git revert' it >>> later as a starting point for someone that wants to implement it). >> >> I went for the minimal change, especially given we know >> that the freebsd folks have a big patchset on top of >> us fixing a lot of bsd-user code and it didn't seem worth >> giving them a more awkward rebase task. > > Perhaps worth mentioning in the commit message that keeping the #if 0 is > intentional, then. At any rate, > > Reviewed-by: Eric Blake <eblake@redhat.com> Thanks; applied to master with an updated commit message. -- PMM
diff --git a/bsd-user/main.c b/bsd-user/main.c index fa9c012..501e16f 100644 --- a/bsd-user/main.c +++ b/bsd-user/main.c @@ -619,9 +619,10 @@ void cpu_loop(CPUSPARCState *env) break; case EXCP_DEBUG: { - int sig; - - sig = gdb_handlesig(cs, TARGET_SIGTRAP); +#if 0 + int sig = +#endif + gdb_handlesig(cs, TARGET_SIGTRAP); #if 0 if (sig) {
On OpenBSD the compiler warns: bsd-user/main.c:622:21: warning: variable 'sig' set but not used [-Wunused-but-set-variable] This is because a lot of the signal delivery code is #if-0'd out as unused. Reshuffle #ifdefs a bit to silence the warning. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> --- bsd-user/main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) -- 2.7.4