8000 php_reflection.c: remove unneeded do-while in `DUMP_CONST_FLAG` macro by DanielEScherzer · Pull Request #15832 · php/php-src · GitHub
[go: up one dir, main page]

Skip to content

php_reflection.c: remove unneeded do-while in DUMP_CONST_FLAG macro #15832

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? Sig 8000 n in to your account

Closed
wants to merge 1 commit into from

Conversation

DanielEScherzer
Copy link
Member

The do-while trick is used to allow including multiple statements where only one is expected, but in this case we know that the uses on the next few lines permit including multiple statements, so the extra do-while wrapper is unneeded.

The do-while trick is used to allow including multiple statements where only
one is expected, but in this case we know that the uses on the next few lines
permit including multiple statements, so the extra do-while wrapper is
unneeded.
@iluuu1994
Copy link
Member

do {} while (0) are considered best-practice for macros. You'll find them in many cases where they aren't strictly necessary. Removing them doesn't add much value.

@iluuu1994
Copy link
Member

As explained here: #15925 (comment) 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0