Skip to content

Commit 96adc80

Browse files
committed
Add -Wstrict-prototypes compiler warning
Disable it for the following extensions: - GD - pspell - readline Closes GH-5888
1 parent ff988a6 commit 96adc80

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

Zend/Zend.m4

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@ AX_CHECK_COMPILE_FLAG([-Wimplicit-fallthrough=1], CFLAGS="$CFLAGS -Wimplicit-fal
214214
AX_CHECK_COMPILE_FLAG([-Wduplicated-cond], CFLAGS="-Wduplicated-cond $CFLAGS", , [-Werror])
215215
AX_CHECK_COMPILE_FLAG([-Wlogical-op], CFLAGS="-Wlogical-op $CFLAGS", , [-Werror])
216216
AX_CHECK_COMPILE_FLAG([-Wformat-truncation], CFLAGS="-Wformat-truncation $CFLAGS", , [-Werror])
217+
AX_CHECK_COMPILE_FLAG([-Wstrict-prototypes], CFLAGS="-Wstrict-prototypes $CFLAGS", , [-Werror])
217218
AX_CHECK_COMPILE_FLAG([-fno-common], CFLAGS="-fno-common $CFLAGS", , [-Werror])
218219
219220
test -n "$DEBUG_CFLAGS" && CFLAGS="$CFLAGS $DEBUG_CFLAGS"

ext/gd/config.m4

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,8 @@ dnl
138138
if test "$PHP_GD" != "no"; then
139139

140140
if test "$PHP_EXTERNAL_GD" = "no"; then
141-
GD_CFLAGS=""
141+
dnl Disable strict prototypes as GD takes advantages of variadic function signatures for function pointers.
142+
GD_CFLAGS="-Wno-strict-prototypes"
142143
extra_sources="libgd/gd.c libgd/gd_gd.c libgd/gd_gd2.c libgd/gd_io.c libgd/gd_io_dp.c \
143144
libgd/gd_io_file.c libgd/gd_ss.c libgd/gd_io_ss.c libgd/gd_webp.c \
144145
libgd/gd_png.c libgd/gd_jpeg.c libgd/gdxpm.c libgd/gdfontt.c libgd/gdfonts.c \

ext/pspell/config.m4

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ PHP_ARG_WITH([pspell],
44
[Include PSPELL support. GNU Aspell version 0.50.0 or higher required])])
55

66
if test "$PHP_PSPELL" != "no"; then
7-
PHP_NEW_EXTENSION(pspell, pspell.c, $ext_shared)
7+
dnl Add -Wno-strict-prototypes as depends on user libs
8+
PHP_NEW_EXTENSION(pspell, pspell.c, $ext_shared, , "-Wno-strict-prototypes")
89
if test "$PHP_PSPELL" != "yes"; then
910
PSPELL_SEARCH_DIRS=$PHP_PSPELL
1011
else

ext/readline/config.m4

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ elif test "$PHP_LIBEDIT" != "no"; then
137137
fi
138138

139139
if test "$PHP_READLINE" != "no" || test "$PHP_LIBEDIT" != "no"; then
140-
PHP_NEW_EXTENSION(readline, readline.c readline_cli.c, $ext_shared, cli)
140+
dnl Add -Wno-strict-prototypes as depends on user libs
141+
PHP_NEW_EXTENSION(readline, readline.c readline_cli.c, $ext_shared, cli, "-Wno-strict-prototypes")
141142
PHP_SUBST(READLINE_SHARED_LIBADD)
142143
fi

0 commit comments

Comments
 (0)