diff options
Diffstat (limited to 'meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/0002-Fix-gcc-build-problem.patch')
-rw-r--r-- | meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/0002-Fix-gcc-build-problem.patch | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/0002-Fix-gcc-build-problem.patch b/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/0002-Fix-gcc-build-problem.patch new file mode 100644 index 000000000..2f7542c62 --- /dev/null +++ b/meta-oe/recipes-devtools/microsoft-gsl/microsoft-gsl/0002-Fix-gcc-build-problem.patch | |||
@@ -0,0 +1,82 @@ | |||
1 | From aa4fd1f57794964640005900c2b47af1a0940b7b Mon Sep 17 00:00:00 2001 | ||
2 | From: Werner Henze <w.henze@avm.de> | ||
3 | Date: Fri, 1 Mar 2024 15:53:50 +0100 | ||
4 | Subject: [PATCH] Fix gcc build problem | ||
5 | |||
6 | Closes issue #1148 by fixing problems introduced in PR #1140. | ||
7 | |||
8 | Upstream-Status: Submitted [https://github.com/microsoft/GSL/pull/1149] | ||
9 | |||
10 | Signed-off-by: Peter Marko <peter.marko@siemens.com> | ||
11 | --- | ||
12 | include/gsl/span | 12 ++++++++---- | ||
13 | include/gsl/util | 12 ++++++++---- | ||
14 | 2 files changed, 16 insertions(+), 8 deletions(-) | ||
15 | |||
16 | diff --git a/include/gsl/span b/include/gsl/span | ||
17 | index 0de2932..d2ef9f7 100644 | ||
18 | --- a/include/gsl/span | ||
19 | +++ b/include/gsl/span | ||
20 | @@ -59,10 +59,12 @@ | ||
21 | #endif | ||
22 | |||
23 | // Turn off clang unsafe buffer warnings as all accessed are guarded by runtime checks | ||
24 | -#if defined(__clang__) && __has_warning("-Wunsafe-buffer-usage") | ||
25 | +#if defined(__clang__) | ||
26 | +#if __has_warning("-Wunsafe-buffer-usage") | ||
27 | #pragma clang diagnostic push | ||
28 | #pragma clang diagnostic ignored "-Wunsafe-buffer-usage" | ||
29 | -#endif // defined(__clang__) && __has_warning("-Wunsafe-buffer-usage") | ||
30 | +#endif // __has_warning("-Wunsafe-buffer-usage") | ||
31 | +#endif // defined(__clang__) | ||
32 | |||
33 | namespace gsl | ||
34 | { | ||
35 | @@ -824,8 +826,10 @@ as_writable_bytes(span<ElementType, Extent> s) noexcept | ||
36 | #pragma GCC diagnostic pop | ||
37 | #endif // __GNUC__ > 6 | ||
38 | |||
39 | -#if defined(__clang__) && __has_warning("-Wunsafe-buffer-usage") | ||
40 | +#if defined(__clang__) | ||
41 | +#if __has_warning("-Wunsafe-buffer-usage") | ||
42 | #pragma clang diagnostic pop | ||
43 | -#endif | ||
44 | +#endif // __has_warning("-Wunsafe-buffer-usage") | ||
45 | +#endif // defined(__clang__) | ||
46 | |||
47 | #endif // GSL_SPAN_H | ||
48 | diff --git a/include/gsl/util b/include/gsl/util | ||
49 | index b853017..26b2f5f 100644 | ||
50 | --- a/include/gsl/util | ||
51 | +++ b/include/gsl/util | ||
52 | @@ -40,10 +40,12 @@ | ||
53 | #endif // _MSC_VER | ||
54 | |||
55 | // Turn off clang unsafe buffer warnings as all accessed are guarded by runtime checks | ||
56 | -#if defined(__clang__) && __has_warning("-Wunsafe-buffer-usage") | ||
57 | +#if defined(__clang__) | ||
58 | +#if __has_warning("-Wunsafe-buffer-usage") | ||
59 | #pragma clang diagnostic push | ||
60 | #pragma clang diagnostic ignored "-Wunsafe-buffer-usage" | ||
61 | -#endif // defined(__clang__) && __has_warning("-Wunsafe-buffer-usage") | ||
62 | +#endif // __has_warning("-Wunsafe-buffer-usage") | ||
63 | +#endif // defined(__clang__) | ||
64 | |||
65 | #if defined(__cplusplus) && (__cplusplus >= 201703L) | ||
66 | #define GSL_NODISCARD [[nodiscard]] | ||
67 | @@ -163,8 +165,10 @@ constexpr auto at(std::span<T, extent> sp, const index i) -> decltype(sp[sp.size | ||
68 | |||
69 | #endif // _MSC_VER | ||
70 | |||
71 | -#if defined(__clang__) && __has_warning("-Wunsafe-buffer-usage") | ||
72 | +#if defined(__clang__) | ||
73 | +#if __has_warning("-Wunsafe-buffer-usage") | ||
74 | #pragma clang diagnostic pop | ||
75 | -#endif | ||
76 | +#endif // __has_warning("-Wunsafe-buffer-usage") | ||
77 | +#endif // defined(__clang__) | ||
78 | |||
79 | #endif // GSL_UTIL_H | ||
80 | -- | ||
81 | 2.30.2 | ||
82 | |||