mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Add -Wmissing-variable-declarations to the standard compilation flags
This warning flag detects global variables not declared in header files. This is similar to what -Wmissing-prototypes does for functions. (More correctly, it is similar to what -Wmissing-declarations does for functions, but -Wmissing-prototypes is a superset of that in C.) This flag is new in GCC 14. Clang has supported it for a while. Several recent commits have cleaned up warnings triggered by this, so it should now be clean. Reviewed-by: Andres Freund <andres@anarazel.de> Discussion: https://www.postgresql.org/message-id/flat/e0a62134-83da-4ba4-8cdb-ceb0111c95ce@eisentraut.org
This commit is contained in:
@ -518,6 +518,15 @@ if test "$GCC" = yes -a "$ICC" = no; then
|
||||
# This was included in -Wall/-Wformat in older GCC versions
|
||||
PGAC_PROG_CC_CFLAGS_OPT([-Wformat-security])
|
||||
PGAC_PROG_CXX_CFLAGS_OPT([-Wformat-security])
|
||||
# gcc 14+, clang for a while
|
||||
# (Supported in C++ by clang but not gcc. For consistency, omit in C++.)
|
||||
save_CFLAGS=$CFLAGS
|
||||
PGAC_PROG_CC_CFLAGS_OPT([-Wmissing-variable-declarations])
|
||||
PERMIT_MISSING_VARIABLE_DECLARATIONS=
|
||||
if test x"$save_CFLAGS" != x"$CFLAGS"; then
|
||||
PERMIT_MISSING_VARIABLE_DECLARATIONS=-Wno-missing-variable-declarations
|
||||
fi
|
||||
AC_SUBST(PERMIT_MISSING_VARIABLE_DECLARATIONS)
|
||||
# Disable strict-aliasing rules; needed for gcc 3.3+
|
||||
PGAC_PROG_CC_CFLAGS_OPT([-fno-strict-aliasing])
|
||||
PGAC_PROG_CXX_CFLAGS_OPT([-fno-strict-aliasing])
|
||||
|
Reference in New Issue
Block a user