summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorDavid Rowley <drowley@postgresql.org>2022-10-07 16:50:31 +1300
committerDavid Rowley <drowley@postgresql.org>2022-10-07 16:50:31 +1300
commit0fe954c28584169938e5c0738cfaa9930ce77577 (patch)
tree4ae48f856afe48dd705984f9343cbcd84c343586 /meson.build
parent80ef92675823f14b0dd15a50b31372e27773a1f5 (diff)
downloadpostgresql-0fe954c28584169938e5c0738cfaa9930ce77577.tar.gz
Add -Wshadow=compatible-local to the standard compilation flags
Since cd4e8caaa, we've been able to build the source tree with -Wshadow=compatible-local without any warnings. Lots of work was done by Justin Pryzby and I (David) to get all our code to compile warning free with that flag. In that process, 2 bugs (16d69ec29 and af7d270dd) were discovered and fixed. Additionally, "git log --grep=shadow" shows that there is no shortage of other bugs that have been fixed over the years which were caused by variable shadowing. In light of the above, it seems very much worthwhile to add at least -Wshadow=compatible-local to our standard compilation flags. We *may* want to go further and take this to -Wshadow=local in the future, but we're not ready for that today, so let's add -Wshadow=compatible-local now to help make sure we don't introduce further local variable shadowing. Author: Andres Freund Discussion: https://postgr.es/m/20221006003920.6xlqaoccxwisza5k@awork3.anarazel.de
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build1
1 files changed, 1 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index f0cb01c001..925db70c9d 100644
--- a/meson.build
+++ b/meson.build
@@ -1709,6 +1709,7 @@ common_warning_flags = [
'-Wmissing-format-attribute',
'-Wimplicit-fallthrough=3',
'-Wcast-function-type',
+ '-Wshadow=compatible-local',
# This was included in -Wall/-Wformat in older GCC versions
'-Wformat-security',
]