diff options
2 files changed, 41 insertions, 0 deletions
diff --git a/meta-networking/recipes-connectivity/openthread/ot-br-posix/0001-cmake-Disable-nonnull-compare-warning-on-gcc.patch b/meta-networking/recipes-connectivity/openthread/ot-br-posix/0001-cmake-Disable-nonnull-compare-warning-on-gcc.patch new file mode 100644 index 0000000000..f0bb392a9f --- /dev/null +++ b/meta-networking/recipes-connectivity/openthread/ot-br-posix/0001-cmake-Disable-nonnull-compare-warning-on-gcc.patch | |||
| @@ -0,0 +1,40 @@ | |||
| 1 | From aa706d714294b83db696de2beca9a722a512796f Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Tue, 19 Apr 2022 14:04:40 -0700 | ||
| 4 | Subject: [PATCH] cmake: Disable nonnull-compare warning on gcc | ||
| 5 | |||
| 6 | GCC finds a legit warning which clang does not on code like this | ||
| 7 | |||
| 8 | class Message; | ||
| 9 | void SendResponse(Message & aMessage) | ||
| 10 | { | ||
| 11 | if ((&aMessage) != nullptr) { return; } | ||
| 12 | } | ||
| 13 | |||
| 14 | Perhaps it should be fixed upstream but for now disable treating this | ||
| 15 | warning as error when using gcc | ||
| 16 | |||
| 17 | Upstream-Status: Pending | ||
| 18 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 19 | --- | ||
| 20 | CMakeLists.txt | 4 ++++ | ||
| 21 | 1 file changed, 4 insertions(+) | ||
| 22 | |||
| 23 | diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
| 24 | index 59a567e729..3134740ff6 100644 | ||
| 25 | --- a/CMakeLists.txt | ||
| 26 | +++ b/CMakeLists.txt | ||
| 27 | @@ -57,6 +57,10 @@ endif() | ||
| 28 | |||
| 29 | set(CMAKE_CXX_EXTENSIONS OFF) | ||
| 30 | |||
| 31 | +if (CMAKE_CXX_COMPILER_ID MATCHES "GNU") | ||
| 32 | + add_compile_options(-Wno-error=nonnull-compare) | ||
| 33 | +endif() | ||
| 34 | + | ||
| 35 | if (OTBR_COVERAGE AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") | ||
| 36 | message(STATUS "Coverage: ON") | ||
| 37 | target_compile_options(otbr-config INTERFACE -g -O0 --coverage) | ||
| 38 | -- | ||
| 39 | 2.36.0 | ||
| 40 | |||
diff --git a/meta-networking/recipes-connectivity/openthread/ot-br-posix_git.bb b/meta-networking/recipes-connectivity/openthread/ot-br-posix_git.bb index c1af388627..a16b77849e 100644 --- a/meta-networking/recipes-connectivity/openthread/ot-br-posix_git.bb +++ b/meta-networking/recipes-connectivity/openthread/ot-br-posix_git.bb | |||
| @@ -16,6 +16,7 @@ PV = "0.3.0+git${SRCPV}" | |||
| 16 | 16 | ||
| 17 | SRC_URI = "gitsm://github.com/openthread/ot-br-posix.git;protocol=https;branch=main \ | 17 | SRC_URI = "gitsm://github.com/openthread/ot-br-posix.git;protocol=https;branch=main \ |
| 18 | file://0001-otbr-agent.service.in-remove-pre-exec-hook-for-mdns-.patch \ | 18 | file://0001-otbr-agent.service.in-remove-pre-exec-hook-for-mdns-.patch \ |
| 19 | file://0001-cmake-Disable-nonnull-compare-warning-on-gcc.patch \ | ||
| 19 | " | 20 | " |
| 20 | 21 | ||
| 21 | S = "${WORKDIR}/git" | 22 | S = "${WORKDIR}/git" |
