From: Jay Satiro Date: Sun, 15 Oct 2023 02:28:17 +0000 (-0400) Subject: tool_urlglob: fix build for old gcc versions X-Git-Tag: curl-8_5_0~243 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=82aa0642ec77a3cf6c6c19fef47663409178f83e;p=thirdparty%2Fcurl.git 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 --- 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