-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Add -Wextra compiler flag exclude some of the major offender #5151
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
Conversation
Forgot that the basic Edit: And obviously I also forgot that Travis checks less extensions than Azure Pipelines ... |
So it seems there are a couple of issues remaining:
Fixed with ac89139
Fixed by c7094d8
Fixed with: d4de3f9
The mbstring ones I have trouble understanding how the compiler figures out that it's unsigned as from my limit search it seems that in oniguruma those are Finally the |
a7beb9f
to
89216d1
Compare
Azure pipelines also flags the following extensions: Tidy:
And LDAP:
Edit fixed by: c3e65d9 |
While the values coming from onig are ptrdiff_t, we store them in size_t. I'm not sure whether that's a bug, or whether these values are always non-negative... |
Well I'm imagining that the |
47f95a3
to
2320191
Compare
I've locally enabled the https://gist.github.com/Girgias/273fe236e58d4f1e96e85700f55f568b |
2320191
to
8725f30
Compare
9ef2fc5
to
8520e8c
Compare
So 32 bits has now these added warnings since the addition of Sodium:
|
Seems I missed some FFI warnings (only on ARM):
Fixed by: 69b7d01 |
2f97307
to
98af091
Compare
98af091
to
e63f3f7
Compare
Sees a new warning got introduced in the JIT:
Edit: Fixed by 3e6667d |
6076440
to
dd650ad
Compare
dd650ad
to
8af5625
Compare
644944a
to
1a48979
Compare
107cca1
to
efb655e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG assuming CI passes.
Zend/Zend.m4
Outdated
@@ -221,7 +221,10 @@ else | |||
AC_DEFINE(ZEND_DEBUG,0,[ ]) | |||
fi | |||
|
|||
test -n "$GCC" && CFLAGS="$CFLAGS -Wall -Wno-strict-aliasing" | |||
test -n "$GCC" && CFLAGS="$CFLAGS -Wall -Wno-strict-aliasing -Wextra -Wno-implicit-fallthrough -Wno-unused-parameter -Wno-sign-compare" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move -Wextra
before -Wno-strict-aliasing
.
Zend/Zend.m4
Outdated
@@ -221,7 +221,10 @@ else | |||
AC_DEFINE(ZEND_DEBUG,0,[ ]) | |||
fi | |||
|
|||
test -n "$GCC" && CFLAGS="$CFLAGS -Wall -Wno-strict-aliasing" | |||
test -n "$GCC" && CFLAGS="$CFLAGS -Wall -Wno-strict-aliasing -Wextra -Wno-implicit-fallthrough -Wno-unused-parameter -Wno-sign-compare" | |||
dnl Check if compiler supports -Wn-clobbered (only GCC) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dnl Check if compiler supports -Wn-clobbered (only GCC) | |
dnl Check if compiler supports -Wno-clobbered (only GCC) |
This is an issue in the provided library and needs to be fixed upstream.
This may happen on 32bits
The compile warnings which are explicitly suppressed are: * -Wno-implicit-fallthrough * -Wno-unused-parameter * -Wno-sign-compare * -Wno-clobbered, only with GCC
efb655e
to
8d3d741
Compare
Although I don't think we will be able to add the
-Wextra
flag without disabling some of the warnings which are enabled within this short cut. It seems better to be aware that these issues exist within the codebase.Currently I've disabled
54 flags from-Wextra
:-Wclobbered
which arises a lot within the Opcache extensions and the SAPI.-Wimplicit-fallthrough
even with-W-implicit-fallthrough=1
there are still a large amount of them and a lot in the JIT/Opcache which may be generated files?-Wunused-parameter
this one happens a lot in macros and ZEND/PHP_API functions for extensions BC-Wsign-compare
if someone wants to tackle it, the compiler output for-W-sign-compare
is a bit more than 1000 lines: https://gist.github.com/Girgias/8c7aefc9687515a31efce589e95fc942-Wmissing-field-initializers
only has seven offender but five of them are in PHPDBG, compiler output: https://gist.github.com/Girgias/74251f0a2a2fb08e2262186cc0ec925d