From: Nikita Popov Date: Wed, 15 Apr 2020 08:41:19 +0000 (+0200) Subject: More precise ifunc resolver return type X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7643cf19966fd84c3f122f4887034d0170a04920;p=php More precise ifunc resolver return type Fixes -Wattribute-alias warning. --- diff --git a/ext/standard/base64.c b/ext/standard/base64.c index 2229af960e..79825597ac 100644 --- a/ext/standard/base64.c +++ b/ext/standard/base64.c @@ -383,9 +383,12 @@ zend_string *php_base64_decode_ex_default(const unsigned char *str, size_t lengt PHPAPI zend_string *php_base64_encode(const unsigned char *str, size_t length) __attribute__((ifunc("resolve_base64_encode"))); PHPAPI zend_string *php_base64_decode_ex(const unsigned char *str, size_t length, zend_bool strict) __attribute__((ifunc("resolve_base64_decode"))); +typedef zend_string *(*base64_encode_func_t)(const unsigned char *, size_t); +typedef zend_string *(*base64_decode_func_t)(const unsigned char *, size_t, zend_bool); + ZEND_NO_SANITIZE_ADDRESS ZEND_ATTRIBUTE_UNUSED /* clang mistakenly warns about this */ -static void *resolve_base64_encode() { +static base64_encode_func_t resolve_base64_encode() { # if ZEND_INTRIN_AVX2_FUNC_PROTO if (zend_cpu_supports_avx2()) { return php_base64_encode_avx2; @@ -401,7 +404,7 @@ static void *resolve_base64_encode() { ZEND_NO_SANITIZE_ADDRESS ZEND_ATTRIBUTE_UNUSED /* clang mistakenly warns about this */ -static void *resolve_base64_decode() { +static base64_decode_func_t resolve_base64_decode() { # if ZEND_INTRIN_AVX2_FUNC_PROTO if (zend_cpu_supports_avx2()) { return php_base64_decode_ex_avx2;