aboutsummaryrefslogtreecommitdiff
path: root/io
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2024-12-14 20:12:21 +0800
committerH.J. Lu <hjl.tools@gmail.com>2024-12-15 05:24:19 +0800
commit335ba9b6c1db7030264de7d9e38047f645326e54 (patch)
tree685db365cd22f38549c734ab2bc72c121ae9b784 /io
parent65817569adf011b66d197c773df2d9337da5adb3 (diff)
downloadglibc-335ba9b6c1db7030264de7d9e38047f645326e54.tar.xz
glibc-335ba9b6c1db7030264de7d9e38047f645326e54.zip
Return EXIT_UNSUPPORTED if __builtin_add_overflow unavailable
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 <hjl.tools@gmail.com> Reviewed-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'io')
-rw-r--r--io/tst-utimensat-skeleton.c5
1 files changed, 5 insertions, 0 deletions
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 <inttypes.h>
#include <support/support.h>
#include <support/temp_file.h>
+#include <support/test-driver.h>
#include <stdio.h>
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)
{