Skip to content

Commit

Permalink
Return EXIT_UNSUPPORTED if __builtin_mul_overflow unavailable
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Sam James <[email protected]>
  • Loading branch information
hjl-tools committed Dec 14, 2024
1 parent 1a41fc4 commit 1d40170
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions misc/tst-fd_to_filename.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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

0 comments on commit 1d40170

Please sign in to comment.