-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Generated arginfo header files: replace sizeof()
with strlen()
#16142
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
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.
I'm fine with this change.
What's the motivation for this mass change? I wouldn't go out of my way to use |
Agreeing with Nikita here. It's a fine assumption to have in regular code, but not in widely used macros and generated code. |
When I first got interested in PHP internal development, I wrote an extension (https://github.com/DanielEScherzer/CustomCast/) and since I used the stub generation script, I thought that the preference was for |
The coding conventions call for using `strlen()` on constant strings, but not refactoring existing uses of `sizeof()` unless there is existing refactoring taking place. I have recently sent a few patches that refactored/simplified some of the arginfo headers, but this patch touches more of them. The generated headers present a special case - until they are updated to use `strlen()`, new additions will be forced to use `sizeof()`, since that is what the generator script produces. Let's just make the change now.
fbdf7a8
to
425e7cc
Compare
I rebased the patch, but let me know if I should just abandon this instead |
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.
I don't see a big reason in this renaming.
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.
I also don't think we should do this.
Yeah I don't see much point in it too. |
I think we have decided against this. Thanks nonetheless. |
The coding conventions call for using
strlen()
on constant strings, but not refactoring existing uses ofsizeof()
unless there is existing refactoring taking place. I have recently sent a few patches that refactored/simplified some of the arginfo headers, but this patch touches more of them.The generated headers present a special case - until they are updated to use
strlen()
, new additions will be forced to usesizeof()
, since that is what the generator script produces. Let's just make the change now.