summaryrefslogtreecommitdiff
path: root/0001-add-Wno-error-nonnull-for-test-cpp-api.patch
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2024-01-27 16:41:24 +0000
committerCoprDistGit <infra@openeuler.org>2024-01-27 16:41:24 +0000
commita6d8043066291c0ad56cc803e533733240d5e4b0 (patch)
tree7ab2a6582eb05aa1260b1ebd48db3f63193d9c66 /0001-add-Wno-error-nonnull-for-test-cpp-api.patch
parent270c1e2add71aeddc1a5e4046aae9a24c5673ab7 (diff)
automatic import of pytorch
Diffstat (limited to '0001-add-Wno-error-nonnull-for-test-cpp-api.patch')
-rw-r--r--0001-add-Wno-error-nonnull-for-test-cpp-api.patch29
1 files changed, 29 insertions, 0 deletions
diff --git a/0001-add-Wno-error-nonnull-for-test-cpp-api.patch b/0001-add-Wno-error-nonnull-for-test-cpp-api.patch
new file mode 100644
index 0000000..b498726
--- /dev/null
+++ b/0001-add-Wno-error-nonnull-for-test-cpp-api.patch
@@ -0,0 +1,29 @@
+From 367387bab836c73c23719f97d929572c8b4e0fad Mon Sep 17 00:00:00 2001
+From: Nick Rossenbach <rossenbach@cs.rwth-aachen.de>
+Date: Tue, 18 Apr 2023 23:31:51 +0200
+Subject: [PATCH] Add -Wno-error=nonnull for test/cpp/api/
+
+On some platforms the build might fail due to the nonnull error
+being triggered by different compiler behavior.
+
+Fix for #99278.
+---
+ test/cpp/api/CMakeLists.txt | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/test/cpp/api/CMakeLists.txt b/test/cpp/api/CMakeLists.txt
+index 6b801a073182794..181139b01360c30 100644
+--- a/test/cpp/api/CMakeLists.txt
++++ b/test/cpp/api/CMakeLists.txt
+@@ -80,6 +80,11 @@ if(NOT MSVC)
+ target_compile_options_if_supported(test_api "-Wno-maybe-uninitialized")
+ # gcc gives nonsensical warnings about variadic.h
+ target_compile_options_if_supported(test_api "-Wno-unused-but-set-parameter")
++ # the nonnull check might trigger for some build configurations,
++ # probably happening due to different code optimization
++ # (see e.g. https://rkoucha.fr/tech_corner/nonnull_gcc_attribute.html)
++ # this happened for a riscv build: https://github.com/pytorch/pytorch/issues/99278
++ target_compile_options_if_supported(test_api "-Wno-error=nonnull")
+ endif()
+
+ if(INSTALL_TEST)