Skip to content

Remove custom 'p' length modifier from custom snprintf implementation #5103

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

Closed

Conversation

Girgias
Copy link
Member

@Girgias Girgias commented Jan 21, 2020

From my understanding this gives a zend_long representation, however it seems to be unused going from this grep search: https://gist.github.com/Girgias/06253c18fde29af25ed50b29c0d8da38

Possibly because the long format macros also take care of this modifier? Or maybe it's just mostly used in conjunction with spprintf (which I'll need to make a separate search for).

(Drive by the mysqlnd usage seems to suggest to output a pointer which we don't really support fully from my understanding).

@nikic
Copy link
Member

nikic commented Jan 21, 2020

I think it's pretty likely that this one is used by extensions. We originally used %pd to print zend_long, but later switched to ZEND_LONG_FMT because it plays better with compiler checks for printf.

Can you check usages in PECL extensions for this?

@Girgias
Copy link
Member Author

Girgias commented Jan 21, 2020 via email

@nikic
Copy link
Member

nikic commented Jan 21, 2020

I think @petk used to do this, maybe he can share how it's done?

@Girgias Girgias force-pushed the drop-custom-p-length-modifier-snprintf branch from 11592e7 to dc526c2 Compare January 23, 2020 12:30
@Girgias
Copy link
Member Author

Girgias commented Jan 23, 2020

Made a second commit which removes it from the custom spprintf implementation too, updated the gist accordingly with the grep secondary grep search.

@nikic
Copy link
Member

nikic commented Jan 23, 2020

Speaking of, can you please also apply the I / v removals you did to spprintf? If they're gone from snprintf, they should be gone there as well.

@Girgias
Copy link
Member Author

Girgias commented Jan 23, 2020

@nikic See #5108, seems I need to do some fixes to phpdbg

@petk
Copy link
Member

petk commented Jan 23, 2020

To search occurrences in extensions back then, I've used very dummy technique:

  • a script with a bit of a configuration that downloads all php extensions set in the configuration and then I think grep -Eri 'keyword' was used over those folders. I think I've made a list of those extensions from some pecl XML files and some here https://github.com/gophp7/gophp7-ext/wiki/extensions-catalog. I'll see if I can share that list in some repo or something...

@Girgias
Copy link
Member Author

Girgias commented Feb 4, 2020

@petk did you have time to look into it?

@Girgias
Copy link
Member Author

Girgias commented Mar 25, 2020

Small ping @petk did you have time to look into this?

@petk
Copy link
Member

petk commented Apr 10, 2020

Hello, nope. Don't wait for me here with this check. No time for this script atm :)

@Girgias
Copy link
Member Author

Girgias commented Apr 10, 2020

Hello, nope. Don't wait for me here with this check. No time for this script atm :)

Mind providing the script so that I can run it myself or too complicated?

@Girgias
Copy link
Member Author

Girgias commented Jun 16, 2021

This has been done in 0d6358f

@Girgias Girgias closed this Jun 16, 2021
@Girgias Girgias deleted the drop-custom-p-length-modifier-snprintf branch June 16, 2021 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants