Skip to content

Sync -Wno-implicit-fallthrough #14187

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

petk
Copy link
Member

@petk petk commented May 9, 2024

This is a sync of the #6252 after few years:

  • ext/date: fixed since derickr/timelib@f8caaef Edited: wrong commit pasted, flag was removed in one of the commits
  • ext/hash: warning happens only on 32-bit build in ext/hash/sha3/generic32lc/KeccakP-1600-inplace32BI.c
  • ext/opcache: IR JIT doesn't seem to have this issue
  • ext/pcre remains disabled due to pcre2lib/sljit/sljitNativeARM_64.c

And I'm also checking CI how it looks.

@derickr
Copy link
Member

derickr commented May 22, 2024

What are the warnings without this flag? Ideally for ext/date and lib, this should be warning free.

@petk
Copy link
Member Author

petk commented May 22, 2024

What are the warnings without this flag? Ideally for ext/date and lib, this should be warning free.

For the ext/date, I wasn't able to reproduce the warning. Even on very old commits from PHP-8.2. It seems that this fallthrough warning in ext/date was happening on one of the CI machines back then but now it seems to be working ok with removing this flag. I think something was fixed in the meantime in the timelib. Tested on 32-bit and 64-bit...

@petk petk force-pushed the patch-implicit-fallthrough branch from 7f82cf6 to 760477f Compare June 8, 2024 17:31
petk added a commit that referenced this pull request Jun 8, 2024
This is a sync of the #6252 after few
years:
- ext/date: pending recheck in GH-14187
- ext/hash: warning happens only on 32-bit build in
  ext/hash/sha3/generic32lc/KeccakP-1600-inplace32BI.c
- ext/opcache: IR JIT doesn't seem to have this issue
- ext/pcre remains disabled due to pcre2lib/sljit/sljitNativeARM_64.c
  (should be rechecked and fixed upstream)
@petk petk force-pushed the patch-implicit-fallthrough branch from 760477f to 10c770c Compare June 8, 2024 18:09
@petk
Copy link
Member Author

petk commented Jun 8, 2024

ext/opcache and ext/hash have been synced in 743d1fd.

This is a sync of the php#6252:
- ext/date: seems to be also fixed

Synced in 743d1fd:
- ext/hash
- ext/opcache
- ext/pcre
@petk petk force-pushed the patch-implicit-fallthrough branch from 10c770c to 6fa8e17 Compare July 22, 2024 05:11
@derickr
Copy link
Member

derickr commented Sep 11, 2024

So, why is this patch still needed if timelib has been fixed?

@petk
Copy link
Member Author

petk commented Sep 11, 2024

So, why is this patch still needed if timelib has been fixed?

If the timelib has been fixed, then the -Wno-implicit-fallthrough flag is not needed. That's more of an issue here. Having this flag will not notify if this issue is present or if a new code is added with such issue. If you prefer to leave this flag on entire ext/date code then let's have it. For example, I've removed it in my CMake build system and haven't found any warning emitted when building. Because unintended fallthroughs in case switches sound bad to me as they bring bugs, but that's just me. If these fallthroughs are something that isn't a problem, then ok.

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.

3 participants