]> granicus.if.org Git - php/commitdiff
More precise ifunc resolver return type
authorNikita Popov <nikita.ppv@gmail.com>
Wed, 15 Apr 2020 08:41:19 +0000 (10:41 +0200)
committerNikita Popov <nikita.ppv@gmail.com>
Wed, 15 Apr 2020 09:01:12 +0000 (11:01 +0200)
Fixes -Wattribute-alias warning.

ext/standard/base64.c

index 2229af960e3ef02ba27d3d786108feabfaf03e56..79825597ac0ed65ea3d3f574c69ee69c151fada5 100644 (file)
@@ -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;