Skip to content

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

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Zend/Zend.m4
Original file line number Diff line number Diff line change
@@ -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 -Wextra -Wno-strict-aliasing -Wno-implicit-fallthrough -Wno-unused-parameter -Wno-sign-compare"
dnl Check if compiler supports -Wno-clobbered (only GCC)
AX_CHECK_COMPILE_FLAG([-Wno-clobbered], CFLAGS="$CFLAGS -Wno-clobbered", , [-Werror])
test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLAGS $DEBUG_CFLAGS"
if test "$ZEND_ZTS" = "yes"; then
4 changes: 3 additions & 1 deletion ext/sodium/config.m4
Original file line number Diff line number Diff line change
@@ -11,6 +11,8 @@ if test "$PHP_SODIUM" != "no"; then

AC_DEFINE(HAVE_LIBSODIUMLIB, 1, [ ])

PHP_NEW_EXTENSION(sodium, libsodium.c sodium_pwhash.c, $ext_shared)
dnl Add -Wno-type-limits as this may arise on 32bits platforms
SODIUM_COMPILER_FLAGS="$LIBSODIUM_CFLAGS -Wno-type-limits"
PHP_NEW_EXTENSION(sodium, libsodium.c sodium_pwhash.c, $ext_shared, , $SODIUM_COMPILER_FLAGS)
PHP_SUBST(SODIUM_SHARED_LIBADD)
fi
5 changes: 3 additions & 2 deletions ext/tidy/config.m4
Original file line number Diff line number Diff line change
@@ -65,8 +65,9 @@ if test "$PHP_TIDY" != "no"; then
PHP_ADD_LIBRARY_WITH_PATH($TIDY_LIB_NAME, $TIDY_LIBDIR, TIDY_SHARED_LIBADD)
PHP_ADD_INCLUDE($TIDY_INCDIR)


PHP_NEW_EXTENSION(tidy, tidy.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
dnl Add -Wno-empty-body as this is an issue upstream
TIDY_COMPILER_FLAGS="$TIDY_CFLAGS -Wno-ignored-qualifiers -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
PHP_NEW_EXTENSION(tidy, tidy.c, $ext_shared,, $TIDY_COMPILER_FLAGS)
PHP_SUBST(TIDY_SHARED_LIBADD)
AC_DEFINE(HAVE_TIDY,1,[ ])
fi