From 69c22cee4800a6ae49f595fa4db0350a95be5d15 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Tue, 3 Nov 2026 15:39:36 +0100 Subject: [PATCH 10/10] Add warning option -Wcast-qual All the warnings have been fixed by previous patches, so this can be activated by default now. --- configure | 4 ++-- configure.ac | 4 ++-- meson.build | 1 + 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/configure b/configure index 6b05d4c84ab..4e62d8e67b8 100755 --- a/configure +++ b/configure @@ -5250,8 +5250,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 -Wcast-qual -Wmissing-prototypes -Wpointer-arith" + CXXFLAGS="-Wall -Wcast-qual -Wpointer-arith" # These work in some but not all gcc versions save_CFLAGS=$CFLAGS diff --git a/configure.ac b/configure.ac index 6864268eaa0..8c9618ac953 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 -Wcast-qual -Wmissing-prototypes -Wpointer-arith" + CXXFLAGS="-Wall -Wcast-qual -Wpointer-arith" # 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 3595c847d11..1e60820d77c 100644 --- a/meson.build +++ b/meson.build @@ -2202,6 +2202,7 @@ vectorize_cflags = cc.get_supported_arguments(['-ftree-vectorize']) unroll_loops_cflags = cc.get_supported_arguments(['-funroll-loops']) common_warning_flags = [ + '-Wcast-qual', '-Wpointer-arith', # Really don't want VLAs to be used in our dialect of C '-Werror=vla', -- 2.56.0