Skip to content

Commit 236e12e

Browse files
committed
Drop --with-uncritical-warn-choke configuration option
This selection of suppressed warnings is pretty arbitrary, and apparently disabling it does not raise any more warning for whole php-src (except for `-Wno-deprecated-declarations`). As such it appears to be pretty useless, and it seems to be more appropriate to let users select which warnings to suppress via manually set `CFLAGS`. Since we already apply `/wd4996`[1] when building with MSVC, and there are indeed plenty of deprecation warnings, for now, we apply `-Wno-deprecated-declarations` for Clang builds unconditionally. [1] <https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-3-c4996> Closes GH-17554.
1 parent ed92da8 commit 236e12e

File tree

3 files changed

+4
-6
lines changed

3 files changed

+4
-6
lines changed

UPGRADING

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,9 @@ PHP 8.5 UPGRADE NOTES
293293
* --enable-sanitzer is now supported for MSVC builds. This enables ASan and
294294
debug assertions, and is supported as of MSVC 16.10 and Windows 10.
295295

296+
* The --with-uncritical-warn-choke configuration option for clang builds is
297+
no longer supported. Select warnings to suppress via CFLAGS instead.
298+
296299
* COM:
297300
. The extension is now build shared by default; previously it defaulted to a
298301
static extension, although the official Windows binaries built a shared

win32/build/config.w32

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,6 @@ if (PHP_SECURITY_FLAGS == "yes") {
355355
ADD_FLAG("LDFLAGS", "/NXCOMPAT /DYNAMICBASE ");
356356
}
357357

358-
ARG_WITH("uncritical-warn-choke", "Disable some uncritical warnings", "yes");
359358
ARG_ENABLE("sanitizer", "Enable ASan (and UBSan) extensions", "no");
360359
if (PHP_SANITIZER == "yes" && PHP_DEBUG == "yes") {
361360
ERROR("Use of both --enable-sanitizer and --enable-debug not allowed.");
@@ -377,11 +376,6 @@ if (VS_TOOLSET) {
377376
AC_DEFINE("PHP_HAVE_BUILTIN_SSUBLL_OVERFLOW", 1, "Define to 1 if the compiler supports '__builtin_ssubll_overflow'.");
378377
AC_DEFINE("PHP_HAVE_BUILTIN_SMULL_OVERFLOW", 1, "Define to 1 if the compiler supports '__builtin_smull_overflow '.");
379378
AC_DEFINE("PHP_HAVE_BUILTIN_SMULLL_OVERFLOW", 1, "Define to 1 if the compiler supports '__builtin_smulll_overflow'.");
380-
if (PHP_UNCRITICAL_WARN_CHOKE != "no") {
381-
ADD_FLAG("CFLAGS", "-Wno-ignored-attributes -Wno-deprecated-declarations -Wno-missing-braces " +
382-
"-Wno-logical-op-parentheses -Wno-msvc-include -Wno-invalid-source-encoding -Wno-unknown-pragmas " +
383-
"-Wno-unused-command-line-argument -Wno-unused-function -Wno-ignored-pragma-optimize");
384-
}
385379

386380
if (PHP_SANITIZER == "yes") {
387381
if (COMPILER_NUMERIC_VERSION < 500) {

win32/build/confutils.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3305,6 +3305,7 @@ function toolset_setup_common_cflags()
33053305

33063306
ADD_FLAG("CFLAGS", "/Zc:wchar_t");
33073307
} else if (CLANG_TOOLSET) {
3308+
ADD_FLAG("CFLAGS", "-Wno-deprecated-declarations");
33083309
if (TARGET_ARCH == 'x86') {
33093310
ADD_FLAG('CFLAGS', '-m32');
33103311
} else {

0 commit comments

Comments
 (0)