Skip to content

Drop redundant macro definitions from mbfl_defs.h #17114

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
wants to merge 1 commit into from

Conversation

nielsdos
Copy link
Member

These are defined by the standard include headers we already use. These cause conflicts which cause compiler warnings on some toolchains (see GH-17112).
This fixes the mbstring part of the issue.

These are defined by the standard include headers we already use.
These cause conflicts which cause compiler warnings on some toolchains
(see phpGH-17112).
@nielsdos
Copy link
Member Author

... This is a public header, seriously? Guess this is master-only then, which means that if people compile with Werror on lower branches and hit this it may break the build but we can't really break ABI either 🙄

@nielsdos nielsdos changed the base branch from PHP-8.3 to master December 10, 2024 19:37
@nielsdos
Copy link
Member Author

Conflict is trivial and I'll fix it in the merge, I can't be bothered

@cmb69
Copy link
Member

cmb69 commented Dec 10, 2024

These cause conflicts which cause compiler warnings on some toolchains

I don't quite understand why. These are guarded with #ifndefs, so shouldn't matter to the toolchain. There might be a bug there.

Still, of course it makes sense to remove that.

... This is a public header, seriously?

See #16070. We've been too lazy in the past, and often exported all header files.

In this case, it might be okay to drop the conditional macro definitions for stable branches (more a theoretic API break than an ABI break, anyway).

@nielsdos
Copy link
Member Author

nielsdos commented Dec 10, 2024

I don't quite understand why. These are guarded with #ifndefs, so shouldn't matter to the toolchain. There might be a bug there.

Because it's the opposite right? First this thing gets included and then the standard header. At least that's my understanding.

@cmb69
Copy link
Member

cmb69 commented Dec 10, 2024

Oh, indeed!

#include "mbfl_defs.h"
#include "mbfl_consts.h"
#include "zend.h"

Moving the zend.h include to the top might solve the issue, too (besides that I consider it somewhat doubtful that we're even including zend.h in this "module").

@nielsdos
Copy link
Member Author

That would work indeed, but it's better to get rid of the redundancy altogether 🙂

@alexdowad
Copy link
Contributor

Thanks very much for noticing this issue!

I'm sure there is a lot of other "cruft" in mbstring which could be cleaned out.

@cmb69
Copy link
Member

cmb69 commented Dec 10, 2024

@nielsdos, I fully agree that we should drop that nonsentical fallback definitions, but perhaps it's "safer" to only change the include order for stable versions. Or maybe we should do both right away.

@nielsdos
Copy link
Member Author

We can change the include order for stable

Copy link
Contributor

@youkidearitai youkidearitai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Thanks!

@nielsdos nielsdos closed this in 75e7234 Dec 11, 2024
nielsdos added a commit that referenced this pull request Dec 11, 2024
charmitro pushed a commit to wasix-org/php that referenced this pull request Mar 13, 2025
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.

4 participants