diff options
author | Khem Raj <raj.khem@gmail.com> | 2024-02-01 18:51:17 -0800 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2024-02-01 19:02:38 -0800 |
commit | b239853fd3bdcdc58a2a862a86fab92ca06d68b8 (patch) | |
tree | dc219820d9288dc5a170a16317b90affd0b07c3f /meta-oe/recipes-devtools/flatcc | |
parent | b4d8d8626efac1e93749c7fd778e241716cf9c4f (diff) | |
download | meta-openembedded-b239853fd3bdcdc58a2a862a86fab92ca06d68b8.tar.gz |
flatcc: Fix build warnings found with clang-18
Fix what we can, and also disable warning-as-error as some compilers can
be quite ambitious.
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe/recipes-devtools/flatcc')
-rw-r--r-- | meta-oe/recipes-devtools/flatcc/flatcc/0001-Check-for-C-standard-version-23-for-__fallthrough__.patch | 31 | ||||
-rw-r--r-- | meta-oe/recipes-devtools/flatcc/flatcc_git.bb | 2 |
2 files changed, 33 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/flatcc/flatcc/0001-Check-for-C-standard-version-23-for-__fallthrough__.patch b/meta-oe/recipes-devtools/flatcc/flatcc/0001-Check-for-C-standard-version-23-for-__fallthrough__.patch new file mode 100644 index 000000000..c9ff55a16 --- /dev/null +++ b/meta-oe/recipes-devtools/flatcc/flatcc/0001-Check-for-C-standard-version-23-for-__fallthrough__.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | From 7c199e3b191a6f714694035f1eba40112e71675c Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Thu, 1 Feb 2024 18:41:51 -0800 | ||
4 | Subject: [PATCH] Check for C standard version >= 23 for [[__fallthrough__]] | ||
5 | |||
6 | This avoids warnings with clang-18+ e.g. | ||
7 | |||
8 | pprintint.h:256:6: error: [[]] attributes are a C23 extension [-Werror,-Wc23-extensions] | ||
9 | |||
10 | Upstream-Status: Submitted [https://github.com/dvidelabs/flatcc/pull/273] | ||
11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
12 | --- | ||
13 | include/flatcc/portable/pattributes.h | 2 +- | ||
14 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
15 | |||
16 | diff --git a/include/flatcc/portable/pattributes.h b/include/flatcc/portable/pattributes.h | ||
17 | index 9240fa3..dd4918a 100644 | ||
18 | --- a/include/flatcc/portable/pattributes.h | ||
19 | +++ b/include/flatcc/portable/pattributes.h | ||
20 | @@ -57,7 +57,7 @@ extern "C" { | ||
21 | |||
22 | |||
23 | /* https://en.cppreference.com/w/c/language/attributes/fallthrough */ | ||
24 | -#if PORTABLE_HAS_C_ATTRIBUTE(__fallthrough__) | ||
25 | +#if PORTABLE_HAS_C_ATTRIBUTE(__fallthrough__) && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L | ||
26 | # define pattribute_fallthrough [[__fallthrough__]] | ||
27 | #elif PORTABLE_HAS_ATTRIBUTE(__fallthrough__) | ||
28 | # define pattribute_fallthrough __attribute__((__fallthrough__)) | ||
29 | -- | ||
30 | 2.43.0 | ||
31 | |||
diff --git a/meta-oe/recipes-devtools/flatcc/flatcc_git.bb b/meta-oe/recipes-devtools/flatcc/flatcc_git.bb index 660a44c5a..161c4107b 100644 --- a/meta-oe/recipes-devtools/flatcc/flatcc_git.bb +++ b/meta-oe/recipes-devtools/flatcc/flatcc_git.bb | |||
@@ -10,6 +10,7 @@ PV = "0.6.2+gitr${SRCPV}" | |||
10 | 10 | ||
11 | SRC_URI = " \ | 11 | SRC_URI = " \ |
12 | git://github.com/dvidelabs/flatcc.git;protocol=https;branch=master \ | 12 | git://github.com/dvidelabs/flatcc.git;protocol=https;branch=master \ |
13 | file://0001-Check-for-C-standard-version-23-for-__fallthrough__.patch \ | ||
13 | " | 14 | " |
14 | SRCREV = "1653ec964730ec7d9892a08a1695ada6d20f5196" | 15 | SRCREV = "1653ec964730ec7d9892a08a1695ada6d20f5196" |
15 | 16 | ||
@@ -22,6 +23,7 @@ inherit cmake | |||
22 | EXTRA_OECMAKE += " \ | 23 | EXTRA_OECMAKE += " \ |
23 | -DFLATCC_INSTALL=On \ | 24 | -DFLATCC_INSTALL=On \ |
24 | -DFLATCC_TEST=Off \ | 25 | -DFLATCC_TEST=Off \ |
26 | -DFLATCC_ALLOW_WERROR=Off \ | ||
25 | " | 27 | " |
26 | 28 | ||
27 | BBCLASSEXTEND = "native nativesdk" | 29 | BBCLASSEXTEND = "native nativesdk" |