Skip to content

Fix -Werror=address-of-packed-member#1664

Merged
morrisonlevi merged 1 commit into
masterfrom
levi/packed
Jul 22, 2022
Merged

Fix -Werror=address-of-packed-member#1664
morrisonlevi merged 1 commit into
masterfrom
levi/packed

Conversation

@morrisonlevi

@morrisonlevi morrisonlevi commented Jul 22, 2022

Copy link
Copy Markdown
Collaborator

Description

The Alpine images recently updated the compiler and now this warning triggers there:

tmp/build_extension/zend_abstract_interface/interceptor/php7/interceptor.c:30:24: error: taking address of packed member of 'struct ' may result in an unaligned pointer value [-Werror=address-of-packed-member]

This fixes the issue by making it aligned to the same alignment as zend_string.

This only occurred on PHP 7.0 for those who are curious.

Readiness checklist

  • Changelog has been added to the release document.
  • Tests added for this feature/bug.

Reviewer checklist

  • Appropriate labels assigned.
  • Milestone is set.

@morrisonlevi morrisonlevi added 🐛 bug Something isn't working c-extension Apply this label to issues and prs related to the C-extension labels Jul 22, 2022
@morrisonlevi morrisonlevi added this to the 0.77.0 milestone Jul 22, 2022
@morrisonlevi
morrisonlevi marked this pull request as ready for review July 22, 2022 05:20
@morrisonlevi
morrisonlevi requested a review from a team as a code owner July 22, 2022 05:20

@bwoebi bwoebi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Never seen such a message or heard that it would cause issues... Btw. when taking .str, the cast to (zend_string*) is redundant, right?

@morrisonlevi

morrisonlevi commented Jul 22, 2022

Copy link
Copy Markdown
Collaborator Author

Btw. when taking .str, the cast to (zend_string*) is redundant, right?

No, because we're still casting away the const. Thanks for the review!

@morrisonlevi
morrisonlevi merged commit 9a577da into master Jul 22, 2022
@morrisonlevi
morrisonlevi deleted the levi/packed branch July 22, 2022 13:08
@bwoebi bwoebi modified the milestones: 0.77.0, v0.76.2 Jul 27, 2022
bwoebi pushed a commit that referenced this pull request Jul 27, 2022
@krakjoe krakjoe mentioned this pull request Jul 27, 2022
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🐛 bug Something isn't working c-extension Apply this label to issues and prs related to the C-extension

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants