Return EXIT_UNSUPPORTED if __builtin_mul_overflow unavailable

Since GCC 4.9 doesn't support __builtin_mul_overflow:

tst-fd_to_filename.c: In function ‘check_ranges’:
tst-fd_to_filename.c:51:3: error: implicit declaration of function ‘__builtin_mul_overflow’ [-Werror=implicit-function-declaration]
   while (!__builtin_mul_overflow (power, base, &power));
   ^
cc1: all warnings being treated as errors

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>
This commit is contained in:
H.J. Lu 2024-12-13 05:59:59 +08:00
parent 1a41fc44da
commit 1d40170dd3
1 changed files with 10 additions and 0 deletions

View File

@ -17,6 +17,7 @@
<https://www.gnu.org/licenses/>. */
#include <fcntl.h>
#if __GNUC_PREREQ (5, 0)
#include <fd_to_filename.h>
#include <stdio.h>
#include <support/check.h>
@ -99,3 +100,12 @@ do_test (void)
}
#include <support/test-driver.c>
#else
#include <support/test-driver.h>
int
main (void)
{
return EXIT_UNSUPPORTED;
}
#endif