From 82aa0642ec77a3cf6c6c19fef47663409178f83e Mon Sep 17 00:00:00 2001 From: Jay Satiro Date: Sat, 14 Oct 2023 22:28:17 -0400 Subject: [PATCH] tool_urlglob: fix build for old gcc versions - Don't use __builtin_mul_overflow for GCC 4 and earlier. The function was added in GCC 5. Ref: https://gcc.gnu.org/gcc-5/changes.html Reported-by: Dan Fandrich Fixes https://github.com/curl/curl/issues/12124 Closes https://github.com/curl/curl/pull/12128 --- src/tool_urlglob.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tool_urlglob.c b/src/tool_urlglob.c index 72eab82ce0..c3840feaa1 100644 --- a/src/tool_urlglob.c +++ b/src/tool_urlglob.c @@ -73,7 +73,8 @@ static int multiply(curl_off_t *amount, curl_off_t with) sum = 0; } else { -#ifdef __GNUC__ +#if defined(__GNUC__) && \ + ((__GNUC__ > 5) || ((__GNUC__ == 5) && (__GNUC_MINOR__ >= 1))) if(__builtin_mul_overflow(*amount, with, &sum)) return 1; #else -- 2.47.3