From 335ba9b6c1db7030264de7d9e38047f645326e54 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Sat, 14 Dec 2024 20:12:21 +0800 Subject: Return EXIT_UNSUPPORTED if __builtin_add_overflow unavailable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since GCC 4.9 doesn't have __builtin_add_overflow: In file included from tst-stringtable.c:180:0: stringtable.c: In function ‘stringtable_finalize’: stringtable.c:185:7: error: implicit declaration of function ‘__builtin_add_overflow’ [-Werror=implicit-function-declaration] else if (__builtin_add_overflow (previous->offset, ^ return EXIT_UNSUPPORTED for GCC 4.9 or older. Signed-off-by: H.J. Lu Reviewed-by: Sam James --- io/tst-utimensat-skeleton.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'io') diff --git a/io/tst-utimensat-skeleton.c b/io/tst-utimensat-skeleton.c index 290ed81c9b..1386fa3c8f 100644 --- a/io/tst-utimensat-skeleton.c +++ b/io/tst-utimensat-skeleton.c @@ -20,6 +20,7 @@ #include #include #include +#include #include static int temp_fd = -1; @@ -72,6 +73,7 @@ do_test (void) for (int i = 0; i < array_length (tests); i++) { /* Check if we run on port with 32 bit time_t size. */ +#if __GNUC_PREREQ (5, 0) time_t t; if (__builtin_add_overflow (tests[i].v1, 0, &t) || __builtin_add_overflow (tests[i].v2, 0, &t)) @@ -80,6 +82,9 @@ do_test (void) "time_t overflows\n", i, tests[i].v1, tests[i].v2); continue; } +#else + return EXIT_UNSUPPORTED; +#endif if (tests[i].v1 >= 0x100000000LL && !y2106) { -- cgit v1.2.3