[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL v2 01/11] build: Silence clang warning on older glib autoptr usage
From: |
John Snow |
Subject: |
[PULL v2 01/11] build: Silence clang warning on older glib autoptr usage |
Date: |
Wed, 18 Mar 2020 16:23:31 -0400 |
From: Eric Blake <address@hidden>
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 <address@hidden>
Signed-off-by: Eric Blake <address@hidden>
Reviewed-by: John Snow <address@hidden>
Message-id: address@hidden
Signed-off-by: John Snow <address@hidden>
---
configure | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/configure b/configure
index 06fcd070fb..479336bf6e 100755
--- a/configure
+++ b/configure
@@ -3851,6 +3851,26 @@ if ! compile_prog "$glib_cflags -Werror" "$glib_libs" ;
then
fi
fi
+# Silence clang warnings triggered by glib < 2.57.2
+cat > $TMPC << EOF
+#include <glib.h>
+typedef struct Foo {
+ int i;
+} Foo;
+static void foo_free(Foo *f)
+{
+ g_free(f);
+}
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(Foo, foo_free);
+int main(void) { return 0; }
+EOF
+if ! compile_prog "$glib_cflags -Werror" "$glib_libs" ; then
+ if cc_has_warning_flag "-Wno-unused-function"; then
+ glib_cflags="$glib_cflags -Wno-unused-function"
+ CFLAGS="$CFLAGS -Wno-unused-function"
+ fi
+fi
+
#########################################
# zlib check
--
2.21.1
- [PULL v2 00/11] Bitmaps patches, John Snow, 2020/03/18
- [PULL v2 01/11] build: Silence clang warning on older glib autoptr usage,
John Snow <=
- [PULL v2 02/11] hbitmap: assert that we don't create bitmap larger than INT64_MAX, John Snow, 2020/03/18
- [PULL v2 03/11] hbitmap: move hbitmap_iter_next_word to hbitmap.c, John Snow, 2020/03/18
- [PULL v2 04/11] hbitmap: unpublish hbitmap_iter_skip_words, John Snow, 2020/03/18
- [PULL v2 09/11] nbd/server: introduce NBDExtentArray, John Snow, 2020/03/18
- [PULL v2 08/11] block/dirty-bitmap: improve _next_dirty_area API, John Snow, 2020/03/18
- [PULL v2 10/11] nbd/server: use bdrv_dirty_bitmap_next_dirty_area, John Snow, 2020/03/18
- [PULL v2 05/11] hbitmap: drop meta bitmaps as they are unused, John Snow, 2020/03/18
- [PULL v2 11/11] block/qcow2-bitmap: use bdrv_dirty_bitmap_next_dirty, John Snow, 2020/03/18
- [PULL v2 07/11] block/dirty-bitmap: add _next_dirty API, John Snow, 2020/03/18
- [PULL v2 06/11] block/dirty-bitmap: switch _next_dirty_area and _next_zero to int64_t, John Snow, 2020/03/18