diff options
author | Khem Raj <raj.khem@gmail.com> | 2023-02-24 09:40:11 -0800 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2023-03-20 07:48:27 -0700 |
commit | 8abfcaa59776cb18c827a21a9b8c0c2e97aed372 (patch) | |
tree | c963763ed74417d573dfee9add6bd49555394183 /recipes-core | |
parent | 75feaf4ffa7cf797b4c1352848dc10b67fb2a76c (diff) | |
download | meta-clang-8abfcaa59776cb18c827a21a9b8c0c2e97aed372.tar.gz |
glib-2.0: Disable -Wincompatible-function-pointer-type with clang-16
This needs to get several recipes to work with clang-16, originally the
problem is in vala I think. Which should be fixed in due course
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'recipes-core')
-rw-r--r-- | recipes-core/glib-2.0/glib-2.0/0001-Ignore-clang-warning-for-function-signature-match.patch | 40 | ||||
-rw-r--r-- | recipes-core/glib-2.0/glib-2.0_%.bbappend | 4 |
2 files changed, 44 insertions, 0 deletions
diff --git a/recipes-core/glib-2.0/glib-2.0/0001-Ignore-clang-warning-for-function-signature-match.patch b/recipes-core/glib-2.0/glib-2.0/0001-Ignore-clang-warning-for-function-signature-match.patch new file mode 100644 index 0000000..ae03849 --- /dev/null +++ b/recipes-core/glib-2.0/glib-2.0/0001-Ignore-clang-warning-for-function-signature-match.patch | |||
@@ -0,0 +1,40 @@ | |||
1 | From 591e8f449e81ae5cb69575eb2e09787b5e0e25cf Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Thu, 23 Feb 2023 14:23:28 -0800 | ||
4 | Subject: [PATCH] Ignore clang warning for function signature match | ||
5 | |||
6 | vala generated code emits GTestDataFunc with gpointer and not | ||
7 | gconstpointer and newer compilers e.g. clang16 can now find out | ||
8 | incompatible-function-pointer-types, which makes code not compile | ||
9 | |||
10 | Fixes | ||
11 | test-vala-lang.c:1166:51: error: incompatible function pointer types passing 'void (gpointer)' (aka 'void (void *)') to parameter of type 'GTestDataFunc' (aka 'v | ||
12 | oid (*)(const void *)') [-Wincompatible-function-pointer-types] | ||
13 | | g_test_add_data_func ("/vala/lookup/sync", NULL, _test_lookup_sync_gtest_data_func); | ||
14 | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
15 | |||
16 | Upstream-Status: Pending | ||
17 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
18 | --- | ||
19 | glib/gtestutils.h | 5 ++++- | ||
20 | 1 file changed, 4 insertions(+), 1 deletion(-) | ||
21 | |||
22 | diff --git a/glib/gtestutils.h b/glib/gtestutils.h | ||
23 | index 86ee4e521..cc237b3f0 100644 | ||
24 | --- a/glib/gtestutils.h | ||
25 | +++ b/glib/gtestutils.h | ||
26 | @@ -34,7 +34,10 @@ | ||
27 | #include <string.h> | ||
28 | |||
29 | G_BEGIN_DECLS | ||
30 | - | ||
31 | +// TODO: This should really be fixed in vala perhaps see | ||
32 | +// https://gitlab.gnome.org/GNOME/vala/-/issues/1413 | ||
33 | +// but it impacts almost 20 packages so workaround it here for now | ||
34 | +#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types" | ||
35 | typedef struct GTestCase GTestCase; | ||
36 | typedef struct GTestSuite GTestSuite; | ||
37 | typedef void (*GTestFunc) (void); | ||
38 | -- | ||
39 | 2.39.2 | ||
40 | |||
diff --git a/recipes-core/glib-2.0/glib-2.0_%.bbappend b/recipes-core/glib-2.0/glib-2.0_%.bbappend index 2aef80e..57e3211 100644 --- a/recipes-core/glib-2.0/glib-2.0_%.bbappend +++ b/recipes-core/glib-2.0/glib-2.0_%.bbappend | |||
@@ -1 +1,5 @@ | |||
1 | FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:" | ||
2 | |||
3 | SRC_URI:append:toolchain-clang = " file://0001-Ignore-clang-warning-for-function-signature-match.patch" | ||
4 | |||
1 | CFLAGS:append:libc-musl = " -Wno-format-nonliteral" | 5 | CFLAGS:append:libc-musl = " -Wno-format-nonliteral" |