On 3/17/20 1:11 PM, Peter Maydell wrote:
On Tue, 17 Mar 2020 at 17:55, Eric Blake <ebl...@redhat.com> wrote:
glib's G_DEFINE_AUTOPTR_CLEANUP_FUNC() macro defines several static
inline functions, often with some of them unused, but prior to 2.57.2
did not mark the functions as such. As a result, clang (but not gcc)
fails to build with older glib unless -Wno-unused-function is enabled.
Reported-by: Peter Maydell <peter.mayd...@linaro.org>
Signed-off-by: Eric Blake <ebl...@redhat.com>
---
Half-tested: I proved to myself that this does NOT enable
-Wno-unused-function on my setup of glib 2.62.5 and gcc 9.2.1 (Fedora
31), but would do so if I introduced an intentional compile error into
the sample program; but Iwas unable to test that it would prevent the
build failure encountered by Peter on John's pull request (older glib
but exact version unknown, clang, on NetBSD).
This wasn't a NetBSD failure. I hit it on my clang-on-x86-64-Ubuntu
setup, and also on FreeBSD. (The latter is just the tests/vm
FreeBSD config, so you can repro that if you need to.)
Not sure where I got NetBSD from (maybe because the build failure
happened in a file with 'nbd' in the name and I gravitated to the 'n'?).
But now that I've re-read your replies to the pull request, I'm glad
to state that my mistake on reproduction platform is confined to the
part after the ---; the commit message itself is accurate as-is.
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org