-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Drop fastcall attribute on variadic function #2975
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Eliminate "fastcall calling convention ignored on variadic function" warning when compiling on 32-bits system with clang
I believe we should just drop the FASTCALL for this function entirely. Fastcall (as a callee-clean calling convention) just doesn't make sense for variadics. Other compilers are probably silently falling back to cdecl as well. E.g. GCC says "If the number of arguments is variable all arguments are pushed on the stack" in the fastcall documentation. |
@nikic: That makes sense. I updated the patch. Do you want me to update the PR title and squash the commits? |
@@ -154,7 +154,7 @@ ZEND_API void ZEND_FASTCALL zend_hash_graceful_destroy(HashTable *ht); | |||
ZEND_API void ZEND_FASTCALL zend_hash_graceful_reverse_destroy(HashTable *ht); | |||
ZEND_API void ZEND_FASTCALL zend_hash_apply(HashTable *ht, apply_func_t apply_func); | |||
ZEND_API void ZEND_FASTCALL zend_hash_apply_with_argument(HashTable *ht, apply_func_arg_t apply_func, void *); | |||
ZEND_API void ZEND_FASTCALL zend_hash_apply_with_arguments(HashTable *ht, apply_func_args_t apply_func, int, ...); | |||
ZEND_API void zend_hash_apply_with_arguments(HashTable *ht, apply_func_args_t apply_func, int, ...); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also has to be changed in the zend_hash.c
file, which still has the fastcall declaration.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Merged as 72ec23d, thanks! |
This is unlikely to be properly supported by compilers anyway, see <php#2975>.
This is unlikely to be properly supported by compilers anyway, see <#2975>.
Eliminate "fastcall calling convention ignored on variadic function"
warning when compiling on 32-bits system with clang