commit:     b8a6ddb6fc1832abc1b396f285b864858bb18026
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Nov 11 10:33:42 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Nov 11 22:47:01 2024 +0000
URL:        https://gitweb.gentoo.org/proj/sandbox.git/commit/?id=b8a6ddb6

tests: handle traps on NULL input for utimensat

When building with -fisolate-erroneous-paths-attribute, GCC turns
the call to utimensat w/ a NULL arg into a trap because of its nonnull
attribute(s). Workaround that in the test.

Bug: https://bugs.gentoo.org/549108
Signed-off-by: Sam James <sam <AT> gentoo.org>

 tests/utimensat-0.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tests/utimensat-0.c b/tests/utimensat-0.c
index 99c3fa4..4e8b89c 100644
--- a/tests/utimensat-0.c
+++ b/tests/utimensat-0.c
@@ -1,3 +1,6 @@
+#pragma GCC push_options
+#pragma GCC 
optimize("-fno-isolate-erroneous-paths-dereference,-fno-isolate-erroneous-paths-attribute")
+
 #define CONFIG HAVE_UTIMENSAT
 #define FUNC utimensat
 #define SFUNC "utimensat"
@@ -20,3 +23,5 @@
        int flags = at_get_flags(s);
 
 #include "test-skel-0.c"
+
+#pragma GCC pop_options

Reply via email to