-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Convert return type of various object handlers from int to zend_result #8755
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
Convert return type of various object handlers from int to zend_result #8755
Conversation
I hesitated doing such a change as this risks breaking more or less every extension which uses objects. But if we are going to do this, wouldn't it make more sense to convert all relevant object handlers to |
zend_result has the same size as int on x64. I'm not sure how it is for other architectures but on x64 + Linux the compiler is perfectly happy keeping the implementation as int. I converted all handlers that return zend_result typed as int, unless I missed any. I in turn didn't change int params to bools because that actually fails compilation because of different sizing. |
MSVC is more strict about function pointers and will complain about them, case in point the build currently fails on Windows because of:
I do think this change is a good change as we have this weird situation where some stuff expects boolean returns and others zend_result and using the appropriate type makes it explicit. |
Yeah, it's just a warning though, it would compile without |
Nevertheless, @Girgias objections to merging this? (after I fix the Windows build of course) |
Nope I'm good, but I think it might make sense to change all object handlers in that case instead of just those, but that can be done as a follow up PR. |
Which are left? I checked all of them, maybe I missed some. |
Oh yes indeed, I think it's the |
@Girgias Yes. As mentioned, converting |
c2c9a04
to
f2d844e
Compare
f2d844e
to
62dba74
Compare
62dba74
to
7f6cae0
Compare
No description provided.