From 44f414be6af1d7519d5543a5c25bff8ea7140cde Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Tue, 15 Sep 2026 08:43:09 +0200 Subject: [PATCH v2 8/8] WIP: Add warning option -Wcast-qual --- configure | 4 ++-- configure.ac | 4 ++-- meson.build | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/configure b/configure index d42a7a794ff..a2bdc4a2a53 100755 --- a/configure +++ b/configure @@ -5249,8 +5249,8 @@ fi # but has its own. Also check other compiler-specific flags here. if test "$GCC" = yes -a "$ICC" = no; then - CFLAGS="-Wall -Wmissing-prototypes -Wpointer-arith" - CXXFLAGS="-Wall -Wpointer-arith" + CFLAGS="-Wall -Wmissing-prototypes -Wpointer-arith -Wcast-qual" + CXXFLAGS="-Wall -Wpointer-arith -Wcast-qual" # These work in some but not all gcc versions save_CFLAGS=$CFLAGS diff --git a/configure.ac b/configure.ac index a331749fcb5..e2c2876675e 100644 --- a/configure.ac +++ b/configure.ac @@ -535,8 +535,8 @@ fi # but has its own. Also check other compiler-specific flags here. if test "$GCC" = yes -a "$ICC" = no; then - CFLAGS="-Wall -Wmissing-prototypes -Wpointer-arith" - CXXFLAGS="-Wall -Wpointer-arith" + CFLAGS="-Wall -Wmissing-prototypes -Wpointer-arith -Wcast-qual" + CXXFLAGS="-Wall -Wpointer-arith -Wcast-qual" # These work in some but not all gcc versions save_CFLAGS=$CFLAGS PGAC_PROG_CC_CFLAGS_OPT([-Wdeclaration-after-statement]) diff --git a/meson.build b/meson.build index f4cde249242..2c1fd41a3c5 100644 --- a/meson.build +++ b/meson.build @@ -2203,6 +2203,7 @@ unroll_loops_cflags = cc.get_supported_arguments(['-funroll-loops']) common_warning_flags = [ '-Wpointer-arith', + '-Wcast-qual', # Really don't want VLAs to be used in our dialect of C '-Werror=vla', # On macOS, complain about usage of symbols newer than the deployment target -- 2.55.0