agora inbox for [email protected]help / color / mirror / Atom feed
[PATCH] Add -Wold-style-definition to CFLAGS. 21+ messages / 2 participants [nested] [flat]
* [PATCH] Add -Wold-style-definition to CFLAGS. @ 2020-05-09 17:38 Andres Freund <[email protected]> 0 siblings, 0 replies; 21+ messages in thread From: Andres Freund @ 2020-05-09 17:38 UTC (permalink / raw) Author: Reviewed-By: Discussion: https://postgr.es/m/ Backpatch: --- src/backend/postmaster/autovacuum.c | 2 +- src/backend/storage/buffer/freelist.c | 2 +- src/backend/utils/adt/jsonpath_scan.l | 2 +- src/backend/utils/misc/queryenvironment.c | 2 +- src/interfaces/libpq/fe-misc.c | 2 +- configure | 41 +++++++++++++++++++++++ configure.in | 2 ++ 7 files changed, 48 insertions(+), 5 deletions(-) diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index 7e97ffab27d..5641f59016d 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -834,7 +834,7 @@ HandleAutoVacLauncherInterrupts(void) * Perform a normal exit from the autovac launcher. */ static void -AutoVacLauncherShutdown() +AutoVacLauncherShutdown(void) { ereport(DEBUG1, (errmsg("autovacuum launcher shutting down"))); diff --git a/src/backend/storage/buffer/freelist.c b/src/backend/storage/buffer/freelist.c index aa5539a2e45..942f8d4edd2 100644 --- a/src/backend/storage/buffer/freelist.c +++ b/src/backend/storage/buffer/freelist.c @@ -177,7 +177,7 @@ ClockSweepTick(void) * should not call this. */ bool -have_free_buffer() +have_free_buffer(void) { if (StrategyControl->firstFreeBuffer >= 0) return true; diff --git a/src/backend/utils/adt/jsonpath_scan.l b/src/backend/utils/adt/jsonpath_scan.l index be0a2cfa2f7..df56a268d62 100644 --- a/src/backend/utils/adt/jsonpath_scan.l +++ b/src/backend/utils/adt/jsonpath_scan.l @@ -330,7 +330,7 @@ static const JsonPathKeyword keywords[] = { /* Check if current scanstring value is a keyword */ static enum yytokentype -checkKeyword() +checkKeyword(void) { int res = IDENT_P; int diff; diff --git a/src/backend/utils/misc/queryenvironment.c b/src/backend/utils/misc/queryenvironment.c index c0b85ed0b36..31de81f353e 100644 --- a/src/backend/utils/misc/queryenvironment.c +++ b/src/backend/utils/misc/queryenvironment.c @@ -36,7 +36,7 @@ struct QueryEnvironment QueryEnvironment * -create_queryEnv() +create_queryEnv(void) { return (QueryEnvironment *) palloc0(sizeof(QueryEnvironment)); } diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c index 19729f96311..9afa0533a62 100644 --- a/src/interfaces/libpq/fe-misc.c +++ b/src/interfaces/libpq/fe-misc.c @@ -1250,7 +1250,7 @@ PQenv2encoding(void) #ifdef ENABLE_NLS static void -libpq_binddomain() +libpq_binddomain(void) { static bool already_bound = false; diff --git a/configure b/configure index 83abe872aa6..b5bd3b2e9c0 100755 --- a/configure +++ b/configure @@ -5321,6 +5321,47 @@ if test x"$pgac_cv_prog_CC_cflags__Wdeclaration_after_statement" = x"yes"; then fi + # Not applicable for C++ + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wold-style-definition, for CFLAGS" >&5 +$as_echo_n "checking whether ${CC} supports -Wold-style-definition, for CFLAGS... " >&6; } +if ${pgac_cv_prog_CC_cflags__Wold_style_definition+:} false; then : + $as_echo_n "(cached) " >&6 +else + pgac_save_CFLAGS=$CFLAGS +pgac_save_CC=$CC +CC=${CC} +CFLAGS="${CFLAGS} -Wold-style-definition" +ac_save_c_werror_flag=$ac_c_werror_flag +ac_c_werror_flag=yes +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + pgac_cv_prog_CC_cflags__Wold_style_definition=yes +else + pgac_cv_prog_CC_cflags__Wold_style_definition=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_c_werror_flag=$ac_save_c_werror_flag +CFLAGS="$pgac_save_CFLAGS" +CC="$pgac_save_CC" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Wold_style_definition" >&5 +$as_echo "$pgac_cv_prog_CC_cflags__Wold_style_definition" >&6; } +if test x"$pgac_cv_prog_CC_cflags__Wold_style_definition" = x"yes"; then + CFLAGS="${CFLAGS} -Wold-style-definition" +fi + + # -Wdeclaration-after-statement isn't applicable for C++. Specific C files # disable it, so AC_SUBST the negative form. PERMIT_DECLARATION_AFTER_STATEMENT= diff --git a/configure.in b/configure.in index ecdf1723967..2b0a88ab911 100644 --- a/configure.in +++ b/configure.in @@ -482,6 +482,8 @@ if test "$GCC" = yes -a "$ICC" = no; then # These work in some but not all gcc versions save_CFLAGS=$CFLAGS PGAC_PROG_CC_CFLAGS_OPT([-Wdeclaration-after-statement]) + # Not applicable for C++ + PGAC_PROG_CC_CFLAGS_OPT([-Wold-style-definition]) # -Wdeclaration-after-statement isn't applicable for C++. Specific C files # disable it, so AC_SUBST the negative form. PERMIT_DECLARATION_AFTER_STATEMENT= -- 2.25.0.114.g5b0ca878e0 --zqfhnontb2zb7pps-- ^ permalink raw reply [nested|flat] 21+ messages in thread
* [PATCH] Add -Wold-style-definition to CFLAGS. @ 2020-05-09 17:38 Andres Freund <[email protected]> 0 siblings, 0 replies; 21+ messages in thread From: Andres Freund @ 2020-05-09 17:38 UTC (permalink / raw) Author: Reviewed-By: Discussion: https://postgr.es/m/ Backpatch: --- src/backend/postmaster/autovacuum.c | 2 +- src/backend/storage/buffer/freelist.c | 2 +- src/backend/utils/adt/jsonpath_scan.l | 2 +- src/backend/utils/misc/queryenvironment.c | 2 +- src/interfaces/libpq/fe-misc.c | 2 +- configure | 41 +++++++++++++++++++++++ configure.in | 2 ++ 7 files changed, 48 insertions(+), 5 deletions(-) diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index 7e97ffab27d..5641f59016d 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -834,7 +834,7 @@ HandleAutoVacLauncherInterrupts(void) * Perform a normal exit from the autovac launcher. */ static void -AutoVacLauncherShutdown() +AutoVacLauncherShutdown(void) { ereport(DEBUG1, (errmsg("autovacuum launcher shutting down"))); diff --git a/src/backend/storage/buffer/freelist.c b/src/backend/storage/buffer/freelist.c index aa5539a2e45..942f8d4edd2 100644 --- a/src/backend/storage/buffer/freelist.c +++ b/src/backend/storage/buffer/freelist.c @@ -177,7 +177,7 @@ ClockSweepTick(void) * should not call this. */ bool -have_free_buffer() +have_free_buffer(void) { if (StrategyControl->firstFreeBuffer >= 0) return true; diff --git a/src/backend/utils/adt/jsonpath_scan.l b/src/backend/utils/adt/jsonpath_scan.l index be0a2cfa2f7..df56a268d62 100644 --- a/src/backend/utils/adt/jsonpath_scan.l +++ b/src/backend/utils/adt/jsonpath_scan.l @@ -330,7 +330,7 @@ static const JsonPathKeyword keywords[] = { /* Check if current scanstring value is a keyword */ static enum yytokentype -checkKeyword() +checkKeyword(void) { int res = IDENT_P; int diff; diff --git a/src/backend/utils/misc/queryenvironment.c b/src/backend/utils/misc/queryenvironment.c index c0b85ed0b36..31de81f353e 100644 --- a/src/backend/utils/misc/queryenvironment.c +++ b/src/backend/utils/misc/queryenvironment.c @@ -36,7 +36,7 @@ struct QueryEnvironment QueryEnvironment * -create_queryEnv() +create_queryEnv(void) { return (QueryEnvironment *) palloc0(sizeof(QueryEnvironment)); } diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c index 19729f96311..9afa0533a62 100644 --- a/src/interfaces/libpq/fe-misc.c +++ b/src/interfaces/libpq/fe-misc.c @@ -1250,7 +1250,7 @@ PQenv2encoding(void) #ifdef ENABLE_NLS static void -libpq_binddomain() +libpq_binddomain(void) { static bool already_bound = false; diff --git a/configure b/configure index 83abe872aa6..b5bd3b2e9c0 100755 --- a/configure +++ b/configure @@ -5321,6 +5321,47 @@ if test x"$pgac_cv_prog_CC_cflags__Wdeclaration_after_statement" = x"yes"; then fi + # Not applicable for C++ + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wold-style-definition, for CFLAGS" >&5 +$as_echo_n "checking whether ${CC} supports -Wold-style-definition, for CFLAGS... " >&6; } +if ${pgac_cv_prog_CC_cflags__Wold_style_definition+:} false; then : + $as_echo_n "(cached) " >&6 +else + pgac_save_CFLAGS=$CFLAGS +pgac_save_CC=$CC +CC=${CC} +CFLAGS="${CFLAGS} -Wold-style-definition" +ac_save_c_werror_flag=$ac_c_werror_flag +ac_c_werror_flag=yes +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + pgac_cv_prog_CC_cflags__Wold_style_definition=yes +else + pgac_cv_prog_CC_cflags__Wold_style_definition=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_c_werror_flag=$ac_save_c_werror_flag +CFLAGS="$pgac_save_CFLAGS" +CC="$pgac_save_CC" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Wold_style_definition" >&5 +$as_echo "$pgac_cv_prog_CC_cflags__Wold_style_definition" >&6; } +if test x"$pgac_cv_prog_CC_cflags__Wold_style_definition" = x"yes"; then + CFLAGS="${CFLAGS} -Wold-style-definition" +fi + + # -Wdeclaration-after-statement isn't applicable for C++. Specific C files # disable it, so AC_SUBST the negative form. PERMIT_DECLARATION_AFTER_STATEMENT= diff --git a/configure.in b/configure.in index ecdf1723967..2b0a88ab911 100644 --- a/configure.in +++ b/configure.in @@ -482,6 +482,8 @@ if test "$GCC" = yes -a "$ICC" = no; then # These work in some but not all gcc versions save_CFLAGS=$CFLAGS PGAC_PROG_CC_CFLAGS_OPT([-Wdeclaration-after-statement]) + # Not applicable for C++ + PGAC_PROG_CC_CFLAGS_OPT([-Wold-style-definition]) # -Wdeclaration-after-statement isn't applicable for C++. Specific C files # disable it, so AC_SUBST the negative form. PERMIT_DECLARATION_AFTER_STATEMENT= -- 2.25.0.114.g5b0ca878e0 --zqfhnontb2zb7pps-- ^ permalink raw reply [nested|flat] 21+ messages in thread
* [PATCH] Add -Wold-style-definition to CFLAGS. @ 2020-05-09 17:38 Andres Freund <[email protected]> 0 siblings, 0 replies; 21+ messages in thread From: Andres Freund @ 2020-05-09 17:38 UTC (permalink / raw) Author: Reviewed-By: Discussion: https://postgr.es/m/ Backpatch: --- src/backend/postmaster/autovacuum.c | 2 +- src/backend/storage/buffer/freelist.c | 2 +- src/backend/utils/adt/jsonpath_scan.l | 2 +- src/backend/utils/misc/queryenvironment.c | 2 +- src/interfaces/libpq/fe-misc.c | 2 +- configure | 41 +++++++++++++++++++++++ configure.in | 2 ++ 7 files changed, 48 insertions(+), 5 deletions(-) diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index 7e97ffab27d..5641f59016d 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -834,7 +834,7 @@ HandleAutoVacLauncherInterrupts(void) * Perform a normal exit from the autovac launcher. */ static void -AutoVacLauncherShutdown() +AutoVacLauncherShutdown(void) { ereport(DEBUG1, (errmsg("autovacuum launcher shutting down"))); diff --git a/src/backend/storage/buffer/freelist.c b/src/backend/storage/buffer/freelist.c index aa5539a2e45..942f8d4edd2 100644 --- a/src/backend/storage/buffer/freelist.c +++ b/src/backend/storage/buffer/freelist.c @@ -177,7 +177,7 @@ ClockSweepTick(void) * should not call this. */ bool -have_free_buffer() +have_free_buffer(void) { if (StrategyControl->firstFreeBuffer >= 0) return true; diff --git a/src/backend/utils/adt/jsonpath_scan.l b/src/backend/utils/adt/jsonpath_scan.l index be0a2cfa2f7..df56a268d62 100644 --- a/src/backend/utils/adt/jsonpath_scan.l +++ b/src/backend/utils/adt/jsonpath_scan.l @@ -330,7 +330,7 @@ static const JsonPathKeyword keywords[] = { /* Check if current scanstring value is a keyword */ static enum yytokentype -checkKeyword() +checkKeyword(void) { int res = IDENT_P; int diff; diff --git a/src/backend/utils/misc/queryenvironment.c b/src/backend/utils/misc/queryenvironment.c index c0b85ed0b36..31de81f353e 100644 --- a/src/backend/utils/misc/queryenvironment.c +++ b/src/backend/utils/misc/queryenvironment.c @@ -36,7 +36,7 @@ struct QueryEnvironment QueryEnvironment * -create_queryEnv() +create_queryEnv(void) { return (QueryEnvironment *) palloc0(sizeof(QueryEnvironment)); } diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c index 19729f96311..9afa0533a62 100644 --- a/src/interfaces/libpq/fe-misc.c +++ b/src/interfaces/libpq/fe-misc.c @@ -1250,7 +1250,7 @@ PQenv2encoding(void) #ifdef ENABLE_NLS static void -libpq_binddomain() +libpq_binddomain(void) { static bool already_bound = false; diff --git a/configure b/configure index 83abe872aa6..b5bd3b2e9c0 100755 --- a/configure +++ b/configure @@ -5321,6 +5321,47 @@ if test x"$pgac_cv_prog_CC_cflags__Wdeclaration_after_statement" = x"yes"; then fi + # Not applicable for C++ + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wold-style-definition, for CFLAGS" >&5 +$as_echo_n "checking whether ${CC} supports -Wold-style-definition, for CFLAGS... " >&6; } +if ${pgac_cv_prog_CC_cflags__Wold_style_definition+:} false; then : + $as_echo_n "(cached) " >&6 +else + pgac_save_CFLAGS=$CFLAGS +pgac_save_CC=$CC +CC=${CC} +CFLAGS="${CFLAGS} -Wold-style-definition" +ac_save_c_werror_flag=$ac_c_werror_flag +ac_c_werror_flag=yes +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + pgac_cv_prog_CC_cflags__Wold_style_definition=yes +else + pgac_cv_prog_CC_cflags__Wold_style_definition=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_c_werror_flag=$ac_save_c_werror_flag +CFLAGS="$pgac_save_CFLAGS" +CC="$pgac_save_CC" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Wold_style_definition" >&5 +$as_echo "$pgac_cv_prog_CC_cflags__Wold_style_definition" >&6; } +if test x"$pgac_cv_prog_CC_cflags__Wold_style_definition" = x"yes"; then + CFLAGS="${CFLAGS} -Wold-style-definition" +fi + + # -Wdeclaration-after-statement isn't applicable for C++. Specific C files # disable it, so AC_SUBST the negative form. PERMIT_DECLARATION_AFTER_STATEMENT= diff --git a/configure.in b/configure.in index ecdf1723967..2b0a88ab911 100644 --- a/configure.in +++ b/configure.in @@ -482,6 +482,8 @@ if test "$GCC" = yes -a "$ICC" = no; then # These work in some but not all gcc versions save_CFLAGS=$CFLAGS PGAC_PROG_CC_CFLAGS_OPT([-Wdeclaration-after-statement]) + # Not applicable for C++ + PGAC_PROG_CC_CFLAGS_OPT([-Wold-style-definition]) # -Wdeclaration-after-statement isn't applicable for C++. Specific C files # disable it, so AC_SUBST the negative form. PERMIT_DECLARATION_AFTER_STATEMENT= -- 2.25.0.114.g5b0ca878e0 --zqfhnontb2zb7pps-- ^ permalink raw reply [nested|flat] 21+ messages in thread
* [PATCH] Add -Wold-style-definition to CFLAGS. @ 2020-05-09 17:38 Andres Freund <[email protected]> 0 siblings, 0 replies; 21+ messages in thread From: Andres Freund @ 2020-05-09 17:38 UTC (permalink / raw) Author: Reviewed-By: Discussion: https://postgr.es/m/ Backpatch: --- src/backend/postmaster/autovacuum.c | 2 +- src/backend/storage/buffer/freelist.c | 2 +- src/backend/utils/adt/jsonpath_scan.l | 2 +- src/backend/utils/misc/queryenvironment.c | 2 +- src/interfaces/libpq/fe-misc.c | 2 +- configure | 41 +++++++++++++++++++++++ configure.in | 2 ++ 7 files changed, 48 insertions(+), 5 deletions(-) diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index 7e97ffab27d..5641f59016d 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -834,7 +834,7 @@ HandleAutoVacLauncherInterrupts(void) * Perform a normal exit from the autovac launcher. */ static void -AutoVacLauncherShutdown() +AutoVacLauncherShutdown(void) { ereport(DEBUG1, (errmsg("autovacuum launcher shutting down"))); diff --git a/src/backend/storage/buffer/freelist.c b/src/backend/storage/buffer/freelist.c index aa5539a2e45..942f8d4edd2 100644 --- a/src/backend/storage/buffer/freelist.c +++ b/src/backend/storage/buffer/freelist.c @@ -177,7 +177,7 @@ ClockSweepTick(void) * should not call this. */ bool -have_free_buffer() +have_free_buffer(void) { if (StrategyControl->firstFreeBuffer >= 0) return true; diff --git a/src/backend/utils/adt/jsonpath_scan.l b/src/backend/utils/adt/jsonpath_scan.l index be0a2cfa2f7..df56a268d62 100644 --- a/src/backend/utils/adt/jsonpath_scan.l +++ b/src/backend/utils/adt/jsonpath_scan.l @@ -330,7 +330,7 @@ static const JsonPathKeyword keywords[] = { /* Check if current scanstring value is a keyword */ static enum yytokentype -checkKeyword() +checkKeyword(void) { int res = IDENT_P; int diff; diff --git a/src/backend/utils/misc/queryenvironment.c b/src/backend/utils/misc/queryenvironment.c index c0b85ed0b36..31de81f353e 100644 --- a/src/backend/utils/misc/queryenvironment.c +++ b/src/backend/utils/misc/queryenvironment.c @@ -36,7 +36,7 @@ struct QueryEnvironment QueryEnvironment * -create_queryEnv() +create_queryEnv(void) { return (QueryEnvironment *) palloc0(sizeof(QueryEnvironment)); } diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c index 19729f96311..9afa0533a62 100644 --- a/src/interfaces/libpq/fe-misc.c +++ b/src/interfaces/libpq/fe-misc.c @@ -1250,7 +1250,7 @@ PQenv2encoding(void) #ifdef ENABLE_NLS static void -libpq_binddomain() +libpq_binddomain(void) { static bool already_bound = false; diff --git a/configure b/configure index 83abe872aa6..b5bd3b2e9c0 100755 --- a/configure +++ b/configure @@ -5321,6 +5321,47 @@ if test x"$pgac_cv_prog_CC_cflags__Wdeclaration_after_statement" = x"yes"; then fi + # Not applicable for C++ + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wold-style-definition, for CFLAGS" >&5 +$as_echo_n "checking whether ${CC} supports -Wold-style-definition, for CFLAGS... " >&6; } +if ${pgac_cv_prog_CC_cflags__Wold_style_definition+:} false; then : + $as_echo_n "(cached) " >&6 +else + pgac_save_CFLAGS=$CFLAGS +pgac_save_CC=$CC +CC=${CC} +CFLAGS="${CFLAGS} -Wold-style-definition" +ac_save_c_werror_flag=$ac_c_werror_flag +ac_c_werror_flag=yes +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + pgac_cv_prog_CC_cflags__Wold_style_definition=yes +else + pgac_cv_prog_CC_cflags__Wold_style_definition=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_c_werror_flag=$ac_save_c_werror_flag +CFLAGS="$pgac_save_CFLAGS" +CC="$pgac_save_CC" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Wold_style_definition" >&5 +$as_echo "$pgac_cv_prog_CC_cflags__Wold_style_definition" >&6; } +if test x"$pgac_cv_prog_CC_cflags__Wold_style_definition" = x"yes"; then + CFLAGS="${CFLAGS} -Wold-style-definition" +fi + + # -Wdeclaration-after-statement isn't applicable for C++. Specific C files # disable it, so AC_SUBST the negative form. PERMIT_DECLARATION_AFTER_STATEMENT= diff --git a/configure.in b/configure.in index ecdf1723967..2b0a88ab911 100644 --- a/configure.in +++ b/configure.in @@ -482,6 +482,8 @@ if test "$GCC" = yes -a "$ICC" = no; then # These work in some but not all gcc versions save_CFLAGS=$CFLAGS PGAC_PROG_CC_CFLAGS_OPT([-Wdeclaration-after-statement]) + # Not applicable for C++ + PGAC_PROG_CC_CFLAGS_OPT([-Wold-style-definition]) # -Wdeclaration-after-statement isn't applicable for C++. Specific C files # disable it, so AC_SUBST the negative form. PERMIT_DECLARATION_AFTER_STATEMENT= -- 2.25.0.114.g5b0ca878e0 --zqfhnontb2zb7pps-- ^ permalink raw reply [nested|flat] 21+ messages in thread
* [PATCH] Add -Wold-style-definition to CFLAGS. @ 2020-05-09 17:38 Andres Freund <[email protected]> 0 siblings, 0 replies; 21+ messages in thread From: Andres Freund @ 2020-05-09 17:38 UTC (permalink / raw) Author: Reviewed-By: Discussion: https://postgr.es/m/ Backpatch: --- src/backend/postmaster/autovacuum.c | 2 +- src/backend/storage/buffer/freelist.c | 2 +- src/backend/utils/adt/jsonpath_scan.l | 2 +- src/backend/utils/misc/queryenvironment.c | 2 +- src/interfaces/libpq/fe-misc.c | 2 +- configure | 41 +++++++++++++++++++++++ configure.in | 2 ++ 7 files changed, 48 insertions(+), 5 deletions(-) diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index 7e97ffab27d..5641f59016d 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -834,7 +834,7 @@ HandleAutoVacLauncherInterrupts(void) * Perform a normal exit from the autovac launcher. */ static void -AutoVacLauncherShutdown() +AutoVacLauncherShutdown(void) { ereport(DEBUG1, (errmsg("autovacuum launcher shutting down"))); diff --git a/src/backend/storage/buffer/freelist.c b/src/backend/storage/buffer/freelist.c index aa5539a2e45..942f8d4edd2 100644 --- a/src/backend/storage/buffer/freelist.c +++ b/src/backend/storage/buffer/freelist.c @@ -177,7 +177,7 @@ ClockSweepTick(void) * should not call this. */ bool -have_free_buffer() +have_free_buffer(void) { if (StrategyControl->firstFreeBuffer >= 0) return true; diff --git a/src/backend/utils/adt/jsonpath_scan.l b/src/backend/utils/adt/jsonpath_scan.l index be0a2cfa2f7..df56a268d62 100644 --- a/src/backend/utils/adt/jsonpath_scan.l +++ b/src/backend/utils/adt/jsonpath_scan.l @@ -330,7 +330,7 @@ static const JsonPathKeyword keywords[] = { /* Check if current scanstring value is a keyword */ static enum yytokentype -checkKeyword() +checkKeyword(void) { int res = IDENT_P; int diff; diff --git a/src/backend/utils/misc/queryenvironment.c b/src/backend/utils/misc/queryenvironment.c index c0b85ed0b36..31de81f353e 100644 --- a/src/backend/utils/misc/queryenvironment.c +++ b/src/backend/utils/misc/queryenvironment.c @@ -36,7 +36,7 @@ struct QueryEnvironment QueryEnvironment * -create_queryEnv() +create_queryEnv(void) { return (QueryEnvironment *) palloc0(sizeof(QueryEnvironment)); } diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c index 19729f96311..9afa0533a62 100644 --- a/src/interfaces/libpq/fe-misc.c +++ b/src/interfaces/libpq/fe-misc.c @@ -1250,7 +1250,7 @@ PQenv2encoding(void) #ifdef ENABLE_NLS static void -libpq_binddomain() +libpq_binddomain(void) { static bool already_bound = false; diff --git a/configure b/configure index 83abe872aa6..b5bd3b2e9c0 100755 --- a/configure +++ b/configure @@ -5321,6 +5321,47 @@ if test x"$pgac_cv_prog_CC_cflags__Wdeclaration_after_statement" = x"yes"; then fi + # Not applicable for C++ + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wold-style-definition, for CFLAGS" >&5 +$as_echo_n "checking whether ${CC} supports -Wold-style-definition, for CFLAGS... " >&6; } +if ${pgac_cv_prog_CC_cflags__Wold_style_definition+:} false; then : + $as_echo_n "(cached) " >&6 +else + pgac_save_CFLAGS=$CFLAGS +pgac_save_CC=$CC +CC=${CC} +CFLAGS="${CFLAGS} -Wold-style-definition" +ac_save_c_werror_flag=$ac_c_werror_flag +ac_c_werror_flag=yes +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + pgac_cv_prog_CC_cflags__Wold_style_definition=yes +else + pgac_cv_prog_CC_cflags__Wold_style_definition=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_c_werror_flag=$ac_save_c_werror_flag +CFLAGS="$pgac_save_CFLAGS" +CC="$pgac_save_CC" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Wold_style_definition" >&5 +$as_echo "$pgac_cv_prog_CC_cflags__Wold_style_definition" >&6; } +if test x"$pgac_cv_prog_CC_cflags__Wold_style_definition" = x"yes"; then + CFLAGS="${CFLAGS} -Wold-style-definition" +fi + + # -Wdeclaration-after-statement isn't applicable for C++. Specific C files # disable it, so AC_SUBST the negative form. PERMIT_DECLARATION_AFTER_STATEMENT= diff --git a/configure.in b/configure.in index ecdf1723967..2b0a88ab911 100644 --- a/configure.in +++ b/configure.in @@ -482,6 +482,8 @@ if test "$GCC" = yes -a "$ICC" = no; then # These work in some but not all gcc versions save_CFLAGS=$CFLAGS PGAC_PROG_CC_CFLAGS_OPT([-Wdeclaration-after-statement]) + # Not applicable for C++ + PGAC_PROG_CC_CFLAGS_OPT([-Wold-style-definition]) # -Wdeclaration-after-statement isn't applicable for C++. Specific C files # disable it, so AC_SUBST the negative form. PERMIT_DECLARATION_AFTER_STATEMENT= -- 2.25.0.114.g5b0ca878e0 --zqfhnontb2zb7pps-- ^ permalink raw reply [nested|flat] 21+ messages in thread
* [PATCH] Add -Wold-style-definition to CFLAGS. @ 2020-05-09 17:38 Andres Freund <[email protected]> 0 siblings, 0 replies; 21+ messages in thread From: Andres Freund @ 2020-05-09 17:38 UTC (permalink / raw) Author: Reviewed-By: Discussion: https://postgr.es/m/ Backpatch: --- src/backend/postmaster/autovacuum.c | 2 +- src/backend/storage/buffer/freelist.c | 2 +- src/backend/utils/adt/jsonpath_scan.l | 2 +- src/backend/utils/misc/queryenvironment.c | 2 +- src/interfaces/libpq/fe-misc.c | 2 +- configure | 41 +++++++++++++++++++++++ configure.in | 2 ++ 7 files changed, 48 insertions(+), 5 deletions(-) diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index 7e97ffab27d..5641f59016d 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -834,7 +834,7 @@ HandleAutoVacLauncherInterrupts(void) * Perform a normal exit from the autovac launcher. */ static void -AutoVacLauncherShutdown() +AutoVacLauncherShutdown(void) { ereport(DEBUG1, (errmsg("autovacuum launcher shutting down"))); diff --git a/src/backend/storage/buffer/freelist.c b/src/backend/storage/buffer/freelist.c index aa5539a2e45..942f8d4edd2 100644 --- a/src/backend/storage/buffer/freelist.c +++ b/src/backend/storage/buffer/freelist.c @@ -177,7 +177,7 @@ ClockSweepTick(void) * should not call this. */ bool -have_free_buffer() +have_free_buffer(void) { if (StrategyControl->firstFreeBuffer >= 0) return true; diff --git a/src/backend/utils/adt/jsonpath_scan.l b/src/backend/utils/adt/jsonpath_scan.l index be0a2cfa2f7..df56a268d62 100644 --- a/src/backend/utils/adt/jsonpath_scan.l +++ b/src/backend/utils/adt/jsonpath_scan.l @@ -330,7 +330,7 @@ static const JsonPathKeyword keywords[] = { /* Check if current scanstring value is a keyword */ static enum yytokentype -checkKeyword() +checkKeyword(void) { int res = IDENT_P; int diff; diff --git a/src/backend/utils/misc/queryenvironment.c b/src/backend/utils/misc/queryenvironment.c index c0b85ed0b36..31de81f353e 100644 --- a/src/backend/utils/misc/queryenvironment.c +++ b/src/backend/utils/misc/queryenvironment.c @@ -36,7 +36,7 @@ struct QueryEnvironment QueryEnvironment * -create_queryEnv() +create_queryEnv(void) { return (QueryEnvironment *) palloc0(sizeof(QueryEnvironment)); } diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c index 19729f96311..9afa0533a62 100644 --- a/src/interfaces/libpq/fe-misc.c +++ b/src/interfaces/libpq/fe-misc.c @@ -1250,7 +1250,7 @@ PQenv2encoding(void) #ifdef ENABLE_NLS static void -libpq_binddomain() +libpq_binddomain(void) { static bool already_bound = false; diff --git a/configure b/configure index 83abe872aa6..b5bd3b2e9c0 100755 --- a/configure +++ b/configure @@ -5321,6 +5321,47 @@ if test x"$pgac_cv_prog_CC_cflags__Wdeclaration_after_statement" = x"yes"; then fi + # Not applicable for C++ + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wold-style-definition, for CFLAGS" >&5 +$as_echo_n "checking whether ${CC} supports -Wold-style-definition, for CFLAGS... " >&6; } +if ${pgac_cv_prog_CC_cflags__Wold_style_definition+:} false; then : + $as_echo_n "(cached) " >&6 +else + pgac_save_CFLAGS=$CFLAGS +pgac_save_CC=$CC +CC=${CC} +CFLAGS="${CFLAGS} -Wold-style-definition" +ac_save_c_werror_flag=$ac_c_werror_flag +ac_c_werror_flag=yes +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + pgac_cv_prog_CC_cflags__Wold_style_definition=yes +else + pgac_cv_prog_CC_cflags__Wold_style_definition=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_c_werror_flag=$ac_save_c_werror_flag +CFLAGS="$pgac_save_CFLAGS" +CC="$pgac_save_CC" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Wold_style_definition" >&5 +$as_echo "$pgac_cv_prog_CC_cflags__Wold_style_definition" >&6; } +if test x"$pgac_cv_prog_CC_cflags__Wold_style_definition" = x"yes"; then + CFLAGS="${CFLAGS} -Wold-style-definition" +fi + + # -Wdeclaration-after-statement isn't applicable for C++. Specific C files # disable it, so AC_SUBST the negative form. PERMIT_DECLARATION_AFTER_STATEMENT= diff --git a/configure.in b/configure.in index ecdf1723967..2b0a88ab911 100644 --- a/configure.in +++ b/configure.in @@ -482,6 +482,8 @@ if test "$GCC" = yes -a "$ICC" = no; then # These work in some but not all gcc versions save_CFLAGS=$CFLAGS PGAC_PROG_CC_CFLAGS_OPT([-Wdeclaration-after-statement]) + # Not applicable for C++ + PGAC_PROG_CC_CFLAGS_OPT([-Wold-style-definition]) # -Wdeclaration-after-statement isn't applicable for C++. Specific C files # disable it, so AC_SUBST the negative form. PERMIT_DECLARATION_AFTER_STATEMENT= -- 2.25.0.114.g5b0ca878e0 --zqfhnontb2zb7pps-- ^ permalink raw reply [nested|flat] 21+ messages in thread
* [PATCH] Add -Wold-style-definition to CFLAGS. @ 2020-05-09 17:38 Andres Freund <[email protected]> 0 siblings, 0 replies; 21+ messages in thread From: Andres Freund @ 2020-05-09 17:38 UTC (permalink / raw) Author: Reviewed-By: Discussion: https://postgr.es/m/ Backpatch: --- src/backend/postmaster/autovacuum.c | 2 +- src/backend/storage/buffer/freelist.c | 2 +- src/backend/utils/adt/jsonpath_scan.l | 2 +- src/backend/utils/misc/queryenvironment.c | 2 +- src/interfaces/libpq/fe-misc.c | 2 +- configure | 41 +++++++++++++++++++++++ configure.in | 2 ++ 7 files changed, 48 insertions(+), 5 deletions(-) diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index 7e97ffab27d..5641f59016d 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -834,7 +834,7 @@ HandleAutoVacLauncherInterrupts(void) * Perform a normal exit from the autovac launcher. */ static void -AutoVacLauncherShutdown() +AutoVacLauncherShutdown(void) { ereport(DEBUG1, (errmsg("autovacuum launcher shutting down"))); diff --git a/src/backend/storage/buffer/freelist.c b/src/backend/storage/buffer/freelist.c index aa5539a2e45..942f8d4edd2 100644 --- a/src/backend/storage/buffer/freelist.c +++ b/src/backend/storage/buffer/freelist.c @@ -177,7 +177,7 @@ ClockSweepTick(void) * should not call this. */ bool -have_free_buffer() +have_free_buffer(void) { if (StrategyControl->firstFreeBuffer >= 0) return true; diff --git a/src/backend/utils/adt/jsonpath_scan.l b/src/backend/utils/adt/jsonpath_scan.l index be0a2cfa2f7..df56a268d62 100644 --- a/src/backend/utils/adt/jsonpath_scan.l +++ b/src/backend/utils/adt/jsonpath_scan.l @@ -330,7 +330,7 @@ static const JsonPathKeyword keywords[] = { /* Check if current scanstring value is a keyword */ static enum yytokentype -checkKeyword() +checkKeyword(void) { int res = IDENT_P; int diff; diff --git a/src/backend/utils/misc/queryenvironment.c b/src/backend/utils/misc/queryenvironment.c index c0b85ed0b36..31de81f353e 100644 --- a/src/backend/utils/misc/queryenvironment.c +++ b/src/backend/utils/misc/queryenvironment.c @@ -36,7 +36,7 @@ struct QueryEnvironment QueryEnvironment * -create_queryEnv() +create_queryEnv(void) { return (QueryEnvironment *) palloc0(sizeof(QueryEnvironment)); } diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c index 19729f96311..9afa0533a62 100644 --- a/src/interfaces/libpq/fe-misc.c +++ b/src/interfaces/libpq/fe-misc.c @@ -1250,7 +1250,7 @@ PQenv2encoding(void) #ifdef ENABLE_NLS static void -libpq_binddomain() +libpq_binddomain(void) { static bool already_bound = false; diff --git a/configure b/configure index 83abe872aa6..b5bd3b2e9c0 100755 --- a/configure +++ b/configure @@ -5321,6 +5321,47 @@ if test x"$pgac_cv_prog_CC_cflags__Wdeclaration_after_statement" = x"yes"; then fi + # Not applicable for C++ + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wold-style-definition, for CFLAGS" >&5 +$as_echo_n "checking whether ${CC} supports -Wold-style-definition, for CFLAGS... " >&6; } +if ${pgac_cv_prog_CC_cflags__Wold_style_definition+:} false; then : + $as_echo_n "(cached) " >&6 +else + pgac_save_CFLAGS=$CFLAGS +pgac_save_CC=$CC +CC=${CC} +CFLAGS="${CFLAGS} -Wold-style-definition" +ac_save_c_werror_flag=$ac_c_werror_flag +ac_c_werror_flag=yes +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + pgac_cv_prog_CC_cflags__Wold_style_definition=yes +else + pgac_cv_prog_CC_cflags__Wold_style_definition=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_c_werror_flag=$ac_save_c_werror_flag +CFLAGS="$pgac_save_CFLAGS" +CC="$pgac_save_CC" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Wold_style_definition" >&5 +$as_echo "$pgac_cv_prog_CC_cflags__Wold_style_definition" >&6; } +if test x"$pgac_cv_prog_CC_cflags__Wold_style_definition" = x"yes"; then + CFLAGS="${CFLAGS} -Wold-style-definition" +fi + + # -Wdeclaration-after-statement isn't applicable for C++. Specific C files # disable it, so AC_SUBST the negative form. PERMIT_DECLARATION_AFTER_STATEMENT= diff --git a/configure.in b/configure.in index ecdf1723967..2b0a88ab911 100644 --- a/configure.in +++ b/configure.in @@ -482,6 +482,8 @@ if test "$GCC" = yes -a "$ICC" = no; then # These work in some but not all gcc versions save_CFLAGS=$CFLAGS PGAC_PROG_CC_CFLAGS_OPT([-Wdeclaration-after-statement]) + # Not applicable for C++ + PGAC_PROG_CC_CFLAGS_OPT([-Wold-style-definition]) # -Wdeclaration-after-statement isn't applicable for C++. Specific C files # disable it, so AC_SUBST the negative form. PERMIT_DECLARATION_AFTER_STATEMENT= -- 2.25.0.114.g5b0ca878e0 --zqfhnontb2zb7pps-- ^ permalink raw reply [nested|flat] 21+ messages in thread
* [PATCH] Add -Wold-style-definition to CFLAGS. @ 2020-05-09 17:38 Andres Freund <[email protected]> 0 siblings, 0 replies; 21+ messages in thread From: Andres Freund @ 2020-05-09 17:38 UTC (permalink / raw) Author: Reviewed-By: Discussion: https://postgr.es/m/ Backpatch: --- src/backend/postmaster/autovacuum.c | 2 +- src/backend/storage/buffer/freelist.c | 2 +- src/backend/utils/adt/jsonpath_scan.l | 2 +- src/backend/utils/misc/queryenvironment.c | 2 +- src/interfaces/libpq/fe-misc.c | 2 +- configure | 41 +++++++++++++++++++++++ configure.in | 2 ++ 7 files changed, 48 insertions(+), 5 deletions(-) diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index 7e97ffab27d..5641f59016d 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -834,7 +834,7 @@ HandleAutoVacLauncherInterrupts(void) * Perform a normal exit from the autovac launcher. */ static void -AutoVacLauncherShutdown() +AutoVacLauncherShutdown(void) { ereport(DEBUG1, (errmsg("autovacuum launcher shutting down"))); diff --git a/src/backend/storage/buffer/freelist.c b/src/backend/storage/buffer/freelist.c index aa5539a2e45..942f8d4edd2 100644 --- a/src/backend/storage/buffer/freelist.c +++ b/src/backend/storage/buffer/freelist.c @@ -177,7 +177,7 @@ ClockSweepTick(void) * should not call this. */ bool -have_free_buffer() +have_free_buffer(void) { if (StrategyControl->firstFreeBuffer >= 0) return true; diff --git a/src/backend/utils/adt/jsonpath_scan.l b/src/backend/utils/adt/jsonpath_scan.l index be0a2cfa2f7..df56a268d62 100644 --- a/src/backend/utils/adt/jsonpath_scan.l +++ b/src/backend/utils/adt/jsonpath_scan.l @@ -330,7 +330,7 @@ static const JsonPathKeyword keywords[] = { /* Check if current scanstring value is a keyword */ static enum yytokentype -checkKeyword() +checkKeyword(void) { int res = IDENT_P; int diff; diff --git a/src/backend/utils/misc/queryenvironment.c b/src/backend/utils/misc/queryenvironment.c index c0b85ed0b36..31de81f353e 100644 --- a/src/backend/utils/misc/queryenvironment.c +++ b/src/backend/utils/misc/queryenvironment.c @@ -36,7 +36,7 @@ struct QueryEnvironment QueryEnvironment * -create_queryEnv() +create_queryEnv(void) { return (QueryEnvironment *) palloc0(sizeof(QueryEnvironment)); } diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c index 19729f96311..9afa0533a62 100644 --- a/src/interfaces/libpq/fe-misc.c +++ b/src/interfaces/libpq/fe-misc.c @@ -1250,7 +1250,7 @@ PQenv2encoding(void) #ifdef ENABLE_NLS static void -libpq_binddomain() +libpq_binddomain(void) { static bool already_bound = false; diff --git a/configure b/configure index 83abe872aa6..b5bd3b2e9c0 100755 --- a/configure +++ b/configure @@ -5321,6 +5321,47 @@ if test x"$pgac_cv_prog_CC_cflags__Wdeclaration_after_statement" = x"yes"; then fi + # Not applicable for C++ + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wold-style-definition, for CFLAGS" >&5 +$as_echo_n "checking whether ${CC} supports -Wold-style-definition, for CFLAGS... " >&6; } +if ${pgac_cv_prog_CC_cflags__Wold_style_definition+:} false; then : + $as_echo_n "(cached) " >&6 +else + pgac_save_CFLAGS=$CFLAGS +pgac_save_CC=$CC +CC=${CC} +CFLAGS="${CFLAGS} -Wold-style-definition" +ac_save_c_werror_flag=$ac_c_werror_flag +ac_c_werror_flag=yes +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + pgac_cv_prog_CC_cflags__Wold_style_definition=yes +else + pgac_cv_prog_CC_cflags__Wold_style_definition=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_c_werror_flag=$ac_save_c_werror_flag +CFLAGS="$pgac_save_CFLAGS" +CC="$pgac_save_CC" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Wold_style_definition" >&5 +$as_echo "$pgac_cv_prog_CC_cflags__Wold_style_definition" >&6; } +if test x"$pgac_cv_prog_CC_cflags__Wold_style_definition" = x"yes"; then + CFLAGS="${CFLAGS} -Wold-style-definition" +fi + + # -Wdeclaration-after-statement isn't applicable for C++. Specific C files # disable it, so AC_SUBST the negative form. PERMIT_DECLARATION_AFTER_STATEMENT= diff --git a/configure.in b/configure.in index ecdf1723967..2b0a88ab911 100644 --- a/configure.in +++ b/configure.in @@ -482,6 +482,8 @@ if test "$GCC" = yes -a "$ICC" = no; then # These work in some but not all gcc versions save_CFLAGS=$CFLAGS PGAC_PROG_CC_CFLAGS_OPT([-Wdeclaration-after-statement]) + # Not applicable for C++ + PGAC_PROG_CC_CFLAGS_OPT([-Wold-style-definition]) # -Wdeclaration-after-statement isn't applicable for C++. Specific C files # disable it, so AC_SUBST the negative form. PERMIT_DECLARATION_AFTER_STATEMENT= -- 2.25.0.114.g5b0ca878e0 --zqfhnontb2zb7pps-- ^ permalink raw reply [nested|flat] 21+ messages in thread
* [PATCH] Add -Wold-style-definition to CFLAGS. @ 2020-05-09 17:38 Andres Freund <[email protected]> 0 siblings, 0 replies; 21+ messages in thread From: Andres Freund @ 2020-05-09 17:38 UTC (permalink / raw) Author: Reviewed-By: Discussion: https://postgr.es/m/ Backpatch: --- src/backend/postmaster/autovacuum.c | 2 +- src/backend/storage/buffer/freelist.c | 2 +- src/backend/utils/adt/jsonpath_scan.l | 2 +- src/backend/utils/misc/queryenvironment.c | 2 +- src/interfaces/libpq/fe-misc.c | 2 +- configure | 41 +++++++++++++++++++++++ configure.in | 2 ++ 7 files changed, 48 insertions(+), 5 deletions(-) diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index 7e97ffab27d..5641f59016d 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -834,7 +834,7 @@ HandleAutoVacLauncherInterrupts(void) * Perform a normal exit from the autovac launcher. */ static void -AutoVacLauncherShutdown() +AutoVacLauncherShutdown(void) { ereport(DEBUG1, (errmsg("autovacuum launcher shutting down"))); diff --git a/src/backend/storage/buffer/freelist.c b/src/backend/storage/buffer/freelist.c index aa5539a2e45..942f8d4edd2 100644 --- a/src/backend/storage/buffer/freelist.c +++ b/src/backend/storage/buffer/freelist.c @@ -177,7 +177,7 @@ ClockSweepTick(void) * should not call this. */ bool -have_free_buffer() +have_free_buffer(void) { if (StrategyControl->firstFreeBuffer >= 0) return true; diff --git a/src/backend/utils/adt/jsonpath_scan.l b/src/backend/utils/adt/jsonpath_scan.l index be0a2cfa2f7..df56a268d62 100644 --- a/src/backend/utils/adt/jsonpath_scan.l +++ b/src/backend/utils/adt/jsonpath_scan.l @@ -330,7 +330,7 @@ static const JsonPathKeyword keywords[] = { /* Check if current scanstring value is a keyword */ static enum yytokentype -checkKeyword() +checkKeyword(void) { int res = IDENT_P; int diff; diff --git a/src/backend/utils/misc/queryenvironment.c b/src/backend/utils/misc/queryenvironment.c index c0b85ed0b36..31de81f353e 100644 --- a/src/backend/utils/misc/queryenvironment.c +++ b/src/backend/utils/misc/queryenvironment.c @@ -36,7 +36,7 @@ struct QueryEnvironment QueryEnvironment * -create_queryEnv() +create_queryEnv(void) { return (QueryEnvironment *) palloc0(sizeof(QueryEnvironment)); } diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c index 19729f96311..9afa0533a62 100644 --- a/src/interfaces/libpq/fe-misc.c +++ b/src/interfaces/libpq/fe-misc.c @@ -1250,7 +1250,7 @@ PQenv2encoding(void) #ifdef ENABLE_NLS static void -libpq_binddomain() +libpq_binddomain(void) { static bool already_bound = false; diff --git a/configure b/configure index 83abe872aa6..b5bd3b2e9c0 100755 --- a/configure +++ b/configure @@ -5321,6 +5321,47 @@ if test x"$pgac_cv_prog_CC_cflags__Wdeclaration_after_statement" = x"yes"; then fi + # Not applicable for C++ + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wold-style-definition, for CFLAGS" >&5 +$as_echo_n "checking whether ${CC} supports -Wold-style-definition, for CFLAGS... " >&6; } +if ${pgac_cv_prog_CC_cflags__Wold_style_definition+:} false; then : + $as_echo_n "(cached) " >&6 +else + pgac_save_CFLAGS=$CFLAGS +pgac_save_CC=$CC +CC=${CC} +CFLAGS="${CFLAGS} -Wold-style-definition" +ac_save_c_werror_flag=$ac_c_werror_flag +ac_c_werror_flag=yes +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + pgac_cv_prog_CC_cflags__Wold_style_definition=yes +else + pgac_cv_prog_CC_cflags__Wold_style_definition=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_c_werror_flag=$ac_save_c_werror_flag +CFLAGS="$pgac_save_CFLAGS" +CC="$pgac_save_CC" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Wold_style_definition" >&5 +$as_echo "$pgac_cv_prog_CC_cflags__Wold_style_definition" >&6; } +if test x"$pgac_cv_prog_CC_cflags__Wold_style_definition" = x"yes"; then + CFLAGS="${CFLAGS} -Wold-style-definition" +fi + + # -Wdeclaration-after-statement isn't applicable for C++. Specific C files # disable it, so AC_SUBST the negative form. PERMIT_DECLARATION_AFTER_STATEMENT= diff --git a/configure.in b/configure.in index ecdf1723967..2b0a88ab911 100644 --- a/configure.in +++ b/configure.in @@ -482,6 +482,8 @@ if test "$GCC" = yes -a "$ICC" = no; then # These work in some but not all gcc versions save_CFLAGS=$CFLAGS PGAC_PROG_CC_CFLAGS_OPT([-Wdeclaration-after-statement]) + # Not applicable for C++ + PGAC_PROG_CC_CFLAGS_OPT([-Wold-style-definition]) # -Wdeclaration-after-statement isn't applicable for C++. Specific C files # disable it, so AC_SUBST the negative form. PERMIT_DECLARATION_AFTER_STATEMENT= -- 2.25.0.114.g5b0ca878e0 --zqfhnontb2zb7pps-- ^ permalink raw reply [nested|flat] 21+ messages in thread
* [PATCH] Add -Wold-style-definition to CFLAGS. @ 2020-05-09 17:38 Andres Freund <[email protected]> 0 siblings, 0 replies; 21+ messages in thread From: Andres Freund @ 2020-05-09 17:38 UTC (permalink / raw) Author: Reviewed-By: Discussion: https://postgr.es/m/ Backpatch: --- src/backend/postmaster/autovacuum.c | 2 +- src/backend/storage/buffer/freelist.c | 2 +- src/backend/utils/adt/jsonpath_scan.l | 2 +- src/backend/utils/misc/queryenvironment.c | 2 +- src/interfaces/libpq/fe-misc.c | 2 +- configure | 41 +++++++++++++++++++++++ configure.in | 2 ++ 7 files changed, 48 insertions(+), 5 deletions(-) diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index 7e97ffab27d..5641f59016d 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -834,7 +834,7 @@ HandleAutoVacLauncherInterrupts(void) * Perform a normal exit from the autovac launcher. */ static void -AutoVacLauncherShutdown() +AutoVacLauncherShutdown(void) { ereport(DEBUG1, (errmsg("autovacuum launcher shutting down"))); diff --git a/src/backend/storage/buffer/freelist.c b/src/backend/storage/buffer/freelist.c index aa5539a2e45..942f8d4edd2 100644 --- a/src/backend/storage/buffer/freelist.c +++ b/src/backend/storage/buffer/freelist.c @@ -177,7 +177,7 @@ ClockSweepTick(void) * should not call this. */ bool -have_free_buffer() +have_free_buffer(void) { if (StrategyControl->firstFreeBuffer >= 0) return true; diff --git a/src/backend/utils/adt/jsonpath_scan.l b/src/backend/utils/adt/jsonpath_scan.l index be0a2cfa2f7..df56a268d62 100644 --- a/src/backend/utils/adt/jsonpath_scan.l +++ b/src/backend/utils/adt/jsonpath_scan.l @@ -330,7 +330,7 @@ static const JsonPathKeyword keywords[] = { /* Check if current scanstring value is a keyword */ static enum yytokentype -checkKeyword() +checkKeyword(void) { int res = IDENT_P; int diff; diff --git a/src/backend/utils/misc/queryenvironment.c b/src/backend/utils/misc/queryenvironment.c index c0b85ed0b36..31de81f353e 100644 --- a/src/backend/utils/misc/queryenvironment.c +++ b/src/backend/utils/misc/queryenvironment.c @@ -36,7 +36,7 @@ struct QueryEnvironment QueryEnvironment * -create_queryEnv() +create_queryEnv(void) { return (QueryEnvironment *) palloc0(sizeof(QueryEnvironment)); } diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c index 19729f96311..9afa0533a62 100644 --- a/src/interfaces/libpq/fe-misc.c +++ b/src/interfaces/libpq/fe-misc.c @@ -1250,7 +1250,7 @@ PQenv2encoding(void) #ifdef ENABLE_NLS static void -libpq_binddomain() +libpq_binddomain(void) { static bool already_bound = false; diff --git a/configure b/configure index 83abe872aa6..b5bd3b2e9c0 100755 --- a/configure +++ b/configure @@ -5321,6 +5321,47 @@ if test x"$pgac_cv_prog_CC_cflags__Wdeclaration_after_statement" = x"yes"; then fi + # Not applicable for C++ + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wold-style-definition, for CFLAGS" >&5 +$as_echo_n "checking whether ${CC} supports -Wold-style-definition, for CFLAGS... " >&6; } +if ${pgac_cv_prog_CC_cflags__Wold_style_definition+:} false; then : + $as_echo_n "(cached) " >&6 +else + pgac_save_CFLAGS=$CFLAGS +pgac_save_CC=$CC +CC=${CC} +CFLAGS="${CFLAGS} -Wold-style-definition" +ac_save_c_werror_flag=$ac_c_werror_flag +ac_c_werror_flag=yes +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + pgac_cv_prog_CC_cflags__Wold_style_definition=yes +else + pgac_cv_prog_CC_cflags__Wold_style_definition=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_c_werror_flag=$ac_save_c_werror_flag +CFLAGS="$pgac_save_CFLAGS" +CC="$pgac_save_CC" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Wold_style_definition" >&5 +$as_echo "$pgac_cv_prog_CC_cflags__Wold_style_definition" >&6; } +if test x"$pgac_cv_prog_CC_cflags__Wold_style_definition" = x"yes"; then + CFLAGS="${CFLAGS} -Wold-style-definition" +fi + + # -Wdeclaration-after-statement isn't applicable for C++. Specific C files # disable it, so AC_SUBST the negative form. PERMIT_DECLARATION_AFTER_STATEMENT= diff --git a/configure.in b/configure.in index ecdf1723967..2b0a88ab911 100644 --- a/configure.in +++ b/configure.in @@ -482,6 +482,8 @@ if test "$GCC" = yes -a "$ICC" = no; then # These work in some but not all gcc versions save_CFLAGS=$CFLAGS PGAC_PROG_CC_CFLAGS_OPT([-Wdeclaration-after-statement]) + # Not applicable for C++ + PGAC_PROG_CC_CFLAGS_OPT([-Wold-style-definition]) # -Wdeclaration-after-statement isn't applicable for C++. Specific C files # disable it, so AC_SUBST the negative form. PERMIT_DECLARATION_AFTER_STATEMENT= -- 2.25.0.114.g5b0ca878e0 --zqfhnontb2zb7pps-- ^ permalink raw reply [nested|flat] 21+ messages in thread
* [PATCH] Add -Wold-style-definition to CFLAGS. @ 2020-05-09 17:38 Andres Freund <[email protected]> 0 siblings, 0 replies; 21+ messages in thread From: Andres Freund @ 2020-05-09 17:38 UTC (permalink / raw) Author: Reviewed-By: Discussion: https://postgr.es/m/ Backpatch: --- src/backend/postmaster/autovacuum.c | 2 +- src/backend/storage/buffer/freelist.c | 2 +- src/backend/utils/adt/jsonpath_scan.l | 2 +- src/backend/utils/misc/queryenvironment.c | 2 +- src/interfaces/libpq/fe-misc.c | 2 +- configure | 41 +++++++++++++++++++++++ configure.in | 2 ++ 7 files changed, 48 insertions(+), 5 deletions(-) diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index 7e97ffab27d..5641f59016d 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -834,7 +834,7 @@ HandleAutoVacLauncherInterrupts(void) * Perform a normal exit from the autovac launcher. */ static void -AutoVacLauncherShutdown() +AutoVacLauncherShutdown(void) { ereport(DEBUG1, (errmsg("autovacuum launcher shutting down"))); diff --git a/src/backend/storage/buffer/freelist.c b/src/backend/storage/buffer/freelist.c index aa5539a2e45..942f8d4edd2 100644 --- a/src/backend/storage/buffer/freelist.c +++ b/src/backend/storage/buffer/freelist.c @@ -177,7 +177,7 @@ ClockSweepTick(void) * should not call this. */ bool -have_free_buffer() +have_free_buffer(void) { if (StrategyControl->firstFreeBuffer >= 0) return true; diff --git a/src/backend/utils/adt/jsonpath_scan.l b/src/backend/utils/adt/jsonpath_scan.l index be0a2cfa2f7..df56a268d62 100644 --- a/src/backend/utils/adt/jsonpath_scan.l +++ b/src/backend/utils/adt/jsonpath_scan.l @@ -330,7 +330,7 @@ static const JsonPathKeyword keywords[] = { /* Check if current scanstring value is a keyword */ static enum yytokentype -checkKeyword() +checkKeyword(void) { int res = IDENT_P; int diff; diff --git a/src/backend/utils/misc/queryenvironment.c b/src/backend/utils/misc/queryenvironment.c index c0b85ed0b36..31de81f353e 100644 --- a/src/backend/utils/misc/queryenvironment.c +++ b/src/backend/utils/misc/queryenvironment.c @@ -36,7 +36,7 @@ struct QueryEnvironment QueryEnvironment * -create_queryEnv() +create_queryEnv(void) { return (QueryEnvironment *) palloc0(sizeof(QueryEnvironment)); } diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c index 19729f96311..9afa0533a62 100644 --- a/src/interfaces/libpq/fe-misc.c +++ b/src/interfaces/libpq/fe-misc.c @@ -1250,7 +1250,7 @@ PQenv2encoding(void) #ifdef ENABLE_NLS static void -libpq_binddomain() +libpq_binddomain(void) { static bool already_bound = false; diff --git a/configure b/configure index 83abe872aa6..b5bd3b2e9c0 100755 --- a/configure +++ b/configure @@ -5321,6 +5321,47 @@ if test x"$pgac_cv_prog_CC_cflags__Wdeclaration_after_statement" = x"yes"; then fi + # Not applicable for C++ + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wold-style-definition, for CFLAGS" >&5 +$as_echo_n "checking whether ${CC} supports -Wold-style-definition, for CFLAGS... " >&6; } +if ${pgac_cv_prog_CC_cflags__Wold_style_definition+:} false; then : + $as_echo_n "(cached) " >&6 +else + pgac_save_CFLAGS=$CFLAGS +pgac_save_CC=$CC +CC=${CC} +CFLAGS="${CFLAGS} -Wold-style-definition" +ac_save_c_werror_flag=$ac_c_werror_flag +ac_c_werror_flag=yes +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + pgac_cv_prog_CC_cflags__Wold_style_definition=yes +else + pgac_cv_prog_CC_cflags__Wold_style_definition=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_c_werror_flag=$ac_save_c_werror_flag +CFLAGS="$pgac_save_CFLAGS" +CC="$pgac_save_CC" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Wold_style_definition" >&5 +$as_echo "$pgac_cv_prog_CC_cflags__Wold_style_definition" >&6; } +if test x"$pgac_cv_prog_CC_cflags__Wold_style_definition" = x"yes"; then + CFLAGS="${CFLAGS} -Wold-style-definition" +fi + + # -Wdeclaration-after-statement isn't applicable for C++. Specific C files # disable it, so AC_SUBST the negative form. PERMIT_DECLARATION_AFTER_STATEMENT= diff --git a/configure.in b/configure.in index ecdf1723967..2b0a88ab911 100644 --- a/configure.in +++ b/configure.in @@ -482,6 +482,8 @@ if test "$GCC" = yes -a "$ICC" = no; then # These work in some but not all gcc versions save_CFLAGS=$CFLAGS PGAC_PROG_CC_CFLAGS_OPT([-Wdeclaration-after-statement]) + # Not applicable for C++ + PGAC_PROG_CC_CFLAGS_OPT([-Wold-style-definition]) # -Wdeclaration-after-statement isn't applicable for C++. Specific C files # disable it, so AC_SUBST the negative form. PERMIT_DECLARATION_AFTER_STATEMENT= -- 2.25.0.114.g5b0ca878e0 --zqfhnontb2zb7pps-- ^ permalink raw reply [nested|flat] 21+ messages in thread
* [PATCH] Add -Wold-style-definition to CFLAGS. @ 2020-05-09 17:38 Andres Freund <[email protected]> 0 siblings, 0 replies; 21+ messages in thread From: Andres Freund @ 2020-05-09 17:38 UTC (permalink / raw) Author: Reviewed-By: Discussion: https://postgr.es/m/ Backpatch: --- src/backend/postmaster/autovacuum.c | 2 +- src/backend/storage/buffer/freelist.c | 2 +- src/backend/utils/adt/jsonpath_scan.l | 2 +- src/backend/utils/misc/queryenvironment.c | 2 +- src/interfaces/libpq/fe-misc.c | 2 +- configure | 41 +++++++++++++++++++++++ configure.in | 2 ++ 7 files changed, 48 insertions(+), 5 deletions(-) diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index 7e97ffab27d..5641f59016d 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -834,7 +834,7 @@ HandleAutoVacLauncherInterrupts(void) * Perform a normal exit from the autovac launcher. */ static void -AutoVacLauncherShutdown() +AutoVacLauncherShutdown(void) { ereport(DEBUG1, (errmsg("autovacuum launcher shutting down"))); diff --git a/src/backend/storage/buffer/freelist.c b/src/backend/storage/buffer/freelist.c index aa5539a2e45..942f8d4edd2 100644 --- a/src/backend/storage/buffer/freelist.c +++ b/src/backend/storage/buffer/freelist.c @@ -177,7 +177,7 @@ ClockSweepTick(void) * should not call this. */ bool -have_free_buffer() +have_free_buffer(void) { if (StrategyControl->firstFreeBuffer >= 0) return true; diff --git a/src/backend/utils/adt/jsonpath_scan.l b/src/backend/utils/adt/jsonpath_scan.l index be0a2cfa2f7..df56a268d62 100644 --- a/src/backend/utils/adt/jsonpath_scan.l +++ b/src/backend/utils/adt/jsonpath_scan.l @@ -330,7 +330,7 @@ static const JsonPathKeyword keywords[] = { /* Check if current scanstring value is a keyword */ static enum yytokentype -checkKeyword() +checkKeyword(void) { int res = IDENT_P; int diff; diff --git a/src/backend/utils/misc/queryenvironment.c b/src/backend/utils/misc/queryenvironment.c index c0b85ed0b36..31de81f353e 100644 --- a/src/backend/utils/misc/queryenvironment.c +++ b/src/backend/utils/misc/queryenvironment.c @@ -36,7 +36,7 @@ struct QueryEnvironment QueryEnvironment * -create_queryEnv() +create_queryEnv(void) { return (QueryEnvironment *) palloc0(sizeof(QueryEnvironment)); } diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c index 19729f96311..9afa0533a62 100644 --- a/src/interfaces/libpq/fe-misc.c +++ b/src/interfaces/libpq/fe-misc.c @@ -1250,7 +1250,7 @@ PQenv2encoding(void) #ifdef ENABLE_NLS static void -libpq_binddomain() +libpq_binddomain(void) { static bool already_bound = false; diff --git a/configure b/configure index 83abe872aa6..b5bd3b2e9c0 100755 --- a/configure +++ b/configure @@ -5321,6 +5321,47 @@ if test x"$pgac_cv_prog_CC_cflags__Wdeclaration_after_statement" = x"yes"; then fi + # Not applicable for C++ + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wold-style-definition, for CFLAGS" >&5 +$as_echo_n "checking whether ${CC} supports -Wold-style-definition, for CFLAGS... " >&6; } +if ${pgac_cv_prog_CC_cflags__Wold_style_definition+:} false; then : + $as_echo_n "(cached) " >&6 +else + pgac_save_CFLAGS=$CFLAGS +pgac_save_CC=$CC +CC=${CC} +CFLAGS="${CFLAGS} -Wold-style-definition" +ac_save_c_werror_flag=$ac_c_werror_flag +ac_c_werror_flag=yes +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + pgac_cv_prog_CC_cflags__Wold_style_definition=yes +else + pgac_cv_prog_CC_cflags__Wold_style_definition=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_c_werror_flag=$ac_save_c_werror_flag +CFLAGS="$pgac_save_CFLAGS" +CC="$pgac_save_CC" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Wold_style_definition" >&5 +$as_echo "$pgac_cv_prog_CC_cflags__Wold_style_definition" >&6; } +if test x"$pgac_cv_prog_CC_cflags__Wold_style_definition" = x"yes"; then + CFLAGS="${CFLAGS} -Wold-style-definition" +fi + + # -Wdeclaration-after-statement isn't applicable for C++. Specific C files # disable it, so AC_SUBST the negative form. PERMIT_DECLARATION_AFTER_STATEMENT= diff --git a/configure.in b/configure.in index ecdf1723967..2b0a88ab911 100644 --- a/configure.in +++ b/configure.in @@ -482,6 +482,8 @@ if test "$GCC" = yes -a "$ICC" = no; then # These work in some but not all gcc versions save_CFLAGS=$CFLAGS PGAC_PROG_CC_CFLAGS_OPT([-Wdeclaration-after-statement]) + # Not applicable for C++ + PGAC_PROG_CC_CFLAGS_OPT([-Wold-style-definition]) # -Wdeclaration-after-statement isn't applicable for C++. Specific C files # disable it, so AC_SUBST the negative form. PERMIT_DECLARATION_AFTER_STATEMENT= -- 2.25.0.114.g5b0ca878e0 --zqfhnontb2zb7pps-- ^ permalink raw reply [nested|flat] 21+ messages in thread
* [PATCH] Add -Wold-style-definition to CFLAGS. @ 2020-05-09 17:38 Andres Freund <[email protected]> 0 siblings, 0 replies; 21+ messages in thread From: Andres Freund @ 2020-05-09 17:38 UTC (permalink / raw) Author: Reviewed-By: Discussion: https://postgr.es/m/ Backpatch: --- src/backend/postmaster/autovacuum.c | 2 +- src/backend/storage/buffer/freelist.c | 2 +- src/backend/utils/adt/jsonpath_scan.l | 2 +- src/backend/utils/misc/queryenvironment.c | 2 +- src/interfaces/libpq/fe-misc.c | 2 +- configure | 41 +++++++++++++++++++++++ configure.in | 2 ++ 7 files changed, 48 insertions(+), 5 deletions(-) diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index 7e97ffab27d..5641f59016d 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -834,7 +834,7 @@ HandleAutoVacLauncherInterrupts(void) * Perform a normal exit from the autovac launcher. */ static void -AutoVacLauncherShutdown() +AutoVacLauncherShutdown(void) { ereport(DEBUG1, (errmsg("autovacuum launcher shutting down"))); diff --git a/src/backend/storage/buffer/freelist.c b/src/backend/storage/buffer/freelist.c index aa5539a2e45..942f8d4edd2 100644 --- a/src/backend/storage/buffer/freelist.c +++ b/src/backend/storage/buffer/freelist.c @@ -177,7 +177,7 @@ ClockSweepTick(void) * should not call this. */ bool -have_free_buffer() +have_free_buffer(void) { if (StrategyControl->firstFreeBuffer >= 0) return true; diff --git a/src/backend/utils/adt/jsonpath_scan.l b/src/backend/utils/adt/jsonpath_scan.l index be0a2cfa2f7..df56a268d62 100644 --- a/src/backend/utils/adt/jsonpath_scan.l +++ b/src/backend/utils/adt/jsonpath_scan.l @@ -330,7 +330,7 @@ static const JsonPathKeyword keywords[] = { /* Check if current scanstring value is a keyword */ static enum yytokentype -checkKeyword() +checkKeyword(void) { int res = IDENT_P; int diff; diff --git a/src/backend/utils/misc/queryenvironment.c b/src/backend/utils/misc/queryenvironment.c index c0b85ed0b36..31de81f353e 100644 --- a/src/backend/utils/misc/queryenvironment.c +++ b/src/backend/utils/misc/queryenvironment.c @@ -36,7 +36,7 @@ struct QueryEnvironment QueryEnvironment * -create_queryEnv() +create_queryEnv(void) { return (QueryEnvironment *) palloc0(sizeof(QueryEnvironment)); } diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c index 19729f96311..9afa0533a62 100644 --- a/src/interfaces/libpq/fe-misc.c +++ b/src/interfaces/libpq/fe-misc.c @@ -1250,7 +1250,7 @@ PQenv2encoding(void) #ifdef ENABLE_NLS static void -libpq_binddomain() +libpq_binddomain(void) { static bool already_bound = false; diff --git a/configure b/configure index 83abe872aa6..b5bd3b2e9c0 100755 --- a/configure +++ b/configure @@ -5321,6 +5321,47 @@ if test x"$pgac_cv_prog_CC_cflags__Wdeclaration_after_statement" = x"yes"; then fi + # Not applicable for C++ + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wold-style-definition, for CFLAGS" >&5 +$as_echo_n "checking whether ${CC} supports -Wold-style-definition, for CFLAGS... " >&6; } +if ${pgac_cv_prog_CC_cflags__Wold_style_definition+:} false; then : + $as_echo_n "(cached) " >&6 +else + pgac_save_CFLAGS=$CFLAGS +pgac_save_CC=$CC +CC=${CC} +CFLAGS="${CFLAGS} -Wold-style-definition" +ac_save_c_werror_flag=$ac_c_werror_flag +ac_c_werror_flag=yes +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + pgac_cv_prog_CC_cflags__Wold_style_definition=yes +else + pgac_cv_prog_CC_cflags__Wold_style_definition=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_c_werror_flag=$ac_save_c_werror_flag +CFLAGS="$pgac_save_CFLAGS" +CC="$pgac_save_CC" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Wold_style_definition" >&5 +$as_echo "$pgac_cv_prog_CC_cflags__Wold_style_definition" >&6; } +if test x"$pgac_cv_prog_CC_cflags__Wold_style_definition" = x"yes"; then + CFLAGS="${CFLAGS} -Wold-style-definition" +fi + + # -Wdeclaration-after-statement isn't applicable for C++. Specific C files # disable it, so AC_SUBST the negative form. PERMIT_DECLARATION_AFTER_STATEMENT= diff --git a/configure.in b/configure.in index ecdf1723967..2b0a88ab911 100644 --- a/configure.in +++ b/configure.in @@ -482,6 +482,8 @@ if test "$GCC" = yes -a "$ICC" = no; then # These work in some but not all gcc versions save_CFLAGS=$CFLAGS PGAC_PROG_CC_CFLAGS_OPT([-Wdeclaration-after-statement]) + # Not applicable for C++ + PGAC_PROG_CC_CFLAGS_OPT([-Wold-style-definition]) # -Wdeclaration-after-statement isn't applicable for C++. Specific C files # disable it, so AC_SUBST the negative form. PERMIT_DECLARATION_AFTER_STATEMENT= -- 2.25.0.114.g5b0ca878e0 --zqfhnontb2zb7pps-- ^ permalink raw reply [nested|flat] 21+ messages in thread
* [PATCH] Add -Wold-style-definition to CFLAGS. @ 2020-05-09 17:38 Andres Freund <[email protected]> 0 siblings, 0 replies; 21+ messages in thread From: Andres Freund @ 2020-05-09 17:38 UTC (permalink / raw) Author: Reviewed-By: Discussion: https://postgr.es/m/ Backpatch: --- src/backend/postmaster/autovacuum.c | 2 +- src/backend/storage/buffer/freelist.c | 2 +- src/backend/utils/adt/jsonpath_scan.l | 2 +- src/backend/utils/misc/queryenvironment.c | 2 +- src/interfaces/libpq/fe-misc.c | 2 +- configure | 41 +++++++++++++++++++++++ configure.in | 2 ++ 7 files changed, 48 insertions(+), 5 deletions(-) diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index 7e97ffab27d..5641f59016d 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -834,7 +834,7 @@ HandleAutoVacLauncherInterrupts(void) * Perform a normal exit from the autovac launcher. */ static void -AutoVacLauncherShutdown() +AutoVacLauncherShutdown(void) { ereport(DEBUG1, (errmsg("autovacuum launcher shutting down"))); diff --git a/src/backend/storage/buffer/freelist.c b/src/backend/storage/buffer/freelist.c index aa5539a2e45..942f8d4edd2 100644 --- a/src/backend/storage/buffer/freelist.c +++ b/src/backend/storage/buffer/freelist.c @@ -177,7 +177,7 @@ ClockSweepTick(void) * should not call this. */ bool -have_free_buffer() +have_free_buffer(void) { if (StrategyControl->firstFreeBuffer >= 0) return true; diff --git a/src/backend/utils/adt/jsonpath_scan.l b/src/backend/utils/adt/jsonpath_scan.l index be0a2cfa2f7..df56a268d62 100644 --- a/src/backend/utils/adt/jsonpath_scan.l +++ b/src/backend/utils/adt/jsonpath_scan.l @@ -330,7 +330,7 @@ static const JsonPathKeyword keywords[] = { /* Check if current scanstring value is a keyword */ static enum yytokentype -checkKeyword() +checkKeyword(void) { int res = IDENT_P; int diff; diff --git a/src/backend/utils/misc/queryenvironment.c b/src/backend/utils/misc/queryenvironment.c index c0b85ed0b36..31de81f353e 100644 --- a/src/backend/utils/misc/queryenvironment.c +++ b/src/backend/utils/misc/queryenvironment.c @@ -36,7 +36,7 @@ struct QueryEnvironment QueryEnvironment * -create_queryEnv() +create_queryEnv(void) { return (QueryEnvironment *) palloc0(sizeof(QueryEnvironment)); } diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c index 19729f96311..9afa0533a62 100644 --- a/src/interfaces/libpq/fe-misc.c +++ b/src/interfaces/libpq/fe-misc.c @@ -1250,7 +1250,7 @@ PQenv2encoding(void) #ifdef ENABLE_NLS static void -libpq_binddomain() +libpq_binddomain(void) { static bool already_bound = false; diff --git a/configure b/configure index 83abe872aa6..b5bd3b2e9c0 100755 --- a/configure +++ b/configure @@ -5321,6 +5321,47 @@ if test x"$pgac_cv_prog_CC_cflags__Wdeclaration_after_statement" = x"yes"; then fi + # Not applicable for C++ + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wold-style-definition, for CFLAGS" >&5 +$as_echo_n "checking whether ${CC} supports -Wold-style-definition, for CFLAGS... " >&6; } +if ${pgac_cv_prog_CC_cflags__Wold_style_definition+:} false; then : + $as_echo_n "(cached) " >&6 +else + pgac_save_CFLAGS=$CFLAGS +pgac_save_CC=$CC +CC=${CC} +CFLAGS="${CFLAGS} -Wold-style-definition" +ac_save_c_werror_flag=$ac_c_werror_flag +ac_c_werror_flag=yes +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + pgac_cv_prog_CC_cflags__Wold_style_definition=yes +else + pgac_cv_prog_CC_cflags__Wold_style_definition=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_c_werror_flag=$ac_save_c_werror_flag +CFLAGS="$pgac_save_CFLAGS" +CC="$pgac_save_CC" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Wold_style_definition" >&5 +$as_echo "$pgac_cv_prog_CC_cflags__Wold_style_definition" >&6; } +if test x"$pgac_cv_prog_CC_cflags__Wold_style_definition" = x"yes"; then + CFLAGS="${CFLAGS} -Wold-style-definition" +fi + + # -Wdeclaration-after-statement isn't applicable for C++. Specific C files # disable it, so AC_SUBST the negative form. PERMIT_DECLARATION_AFTER_STATEMENT= diff --git a/configure.in b/configure.in index ecdf1723967..2b0a88ab911 100644 --- a/configure.in +++ b/configure.in @@ -482,6 +482,8 @@ if test "$GCC" = yes -a "$ICC" = no; then # These work in some but not all gcc versions save_CFLAGS=$CFLAGS PGAC_PROG_CC_CFLAGS_OPT([-Wdeclaration-after-statement]) + # Not applicable for C++ + PGAC_PROG_CC_CFLAGS_OPT([-Wold-style-definition]) # -Wdeclaration-after-statement isn't applicable for C++. Specific C files # disable it, so AC_SUBST the negative form. PERMIT_DECLARATION_AFTER_STATEMENT= -- 2.25.0.114.g5b0ca878e0 --zqfhnontb2zb7pps-- ^ permalink raw reply [nested|flat] 21+ messages in thread
* [PATCH] Add -Wold-style-definition to CFLAGS. @ 2020-05-09 17:38 Andres Freund <[email protected]> 0 siblings, 0 replies; 21+ messages in thread From: Andres Freund @ 2020-05-09 17:38 UTC (permalink / raw) Author: Reviewed-By: Discussion: https://postgr.es/m/ Backpatch: --- src/backend/postmaster/autovacuum.c | 2 +- src/backend/storage/buffer/freelist.c | 2 +- src/backend/utils/adt/jsonpath_scan.l | 2 +- src/backend/utils/misc/queryenvironment.c | 2 +- src/interfaces/libpq/fe-misc.c | 2 +- configure | 41 +++++++++++++++++++++++ configure.in | 2 ++ 7 files changed, 48 insertions(+), 5 deletions(-) diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index 7e97ffab27d..5641f59016d 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -834,7 +834,7 @@ HandleAutoVacLauncherInterrupts(void) * Perform a normal exit from the autovac launcher. */ static void -AutoVacLauncherShutdown() +AutoVacLauncherShutdown(void) { ereport(DEBUG1, (errmsg("autovacuum launcher shutting down"))); diff --git a/src/backend/storage/buffer/freelist.c b/src/backend/storage/buffer/freelist.c index aa5539a2e45..942f8d4edd2 100644 --- a/src/backend/storage/buffer/freelist.c +++ b/src/backend/storage/buffer/freelist.c @@ -177,7 +177,7 @@ ClockSweepTick(void) * should not call this. */ bool -have_free_buffer() +have_free_buffer(void) { if (StrategyControl->firstFreeBuffer >= 0) return true; diff --git a/src/backend/utils/adt/jsonpath_scan.l b/src/backend/utils/adt/jsonpath_scan.l index be0a2cfa2f7..df56a268d62 100644 --- a/src/backend/utils/adt/jsonpath_scan.l +++ b/src/backend/utils/adt/jsonpath_scan.l @@ -330,7 +330,7 @@ static const JsonPathKeyword keywords[] = { /* Check if current scanstring value is a keyword */ static enum yytokentype -checkKeyword() +checkKeyword(void) { int res = IDENT_P; int diff; diff --git a/src/backend/utils/misc/queryenvironment.c b/src/backend/utils/misc/queryenvironment.c index c0b85ed0b36..31de81f353e 100644 --- a/src/backend/utils/misc/queryenvironment.c +++ b/src/backend/utils/misc/queryenvironment.c @@ -36,7 +36,7 @@ struct QueryEnvironment QueryEnvironment * -create_queryEnv() +create_queryEnv(void) { return (QueryEnvironment *) palloc0(sizeof(QueryEnvironment)); } diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c index 19729f96311..9afa0533a62 100644 --- a/src/interfaces/libpq/fe-misc.c +++ b/src/interfaces/libpq/fe-misc.c @@ -1250,7 +1250,7 @@ PQenv2encoding(void) #ifdef ENABLE_NLS static void -libpq_binddomain() +libpq_binddomain(void) { static bool already_bound = false; diff --git a/configure b/configure index 83abe872aa6..b5bd3b2e9c0 100755 --- a/configure +++ b/configure @@ -5321,6 +5321,47 @@ if test x"$pgac_cv_prog_CC_cflags__Wdeclaration_after_statement" = x"yes"; then fi + # Not applicable for C++ + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wold-style-definition, for CFLAGS" >&5 +$as_echo_n "checking whether ${CC} supports -Wold-style-definition, for CFLAGS... " >&6; } +if ${pgac_cv_prog_CC_cflags__Wold_style_definition+:} false; then : + $as_echo_n "(cached) " >&6 +else + pgac_save_CFLAGS=$CFLAGS +pgac_save_CC=$CC +CC=${CC} +CFLAGS="${CFLAGS} -Wold-style-definition" +ac_save_c_werror_flag=$ac_c_werror_flag +ac_c_werror_flag=yes +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + pgac_cv_prog_CC_cflags__Wold_style_definition=yes +else + pgac_cv_prog_CC_cflags__Wold_style_definition=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_c_werror_flag=$ac_save_c_werror_flag +CFLAGS="$pgac_save_CFLAGS" +CC="$pgac_save_CC" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Wold_style_definition" >&5 +$as_echo "$pgac_cv_prog_CC_cflags__Wold_style_definition" >&6; } +if test x"$pgac_cv_prog_CC_cflags__Wold_style_definition" = x"yes"; then + CFLAGS="${CFLAGS} -Wold-style-definition" +fi + + # -Wdeclaration-after-statement isn't applicable for C++. Specific C files # disable it, so AC_SUBST the negative form. PERMIT_DECLARATION_AFTER_STATEMENT= diff --git a/configure.in b/configure.in index ecdf1723967..2b0a88ab911 100644 --- a/configure.in +++ b/configure.in @@ -482,6 +482,8 @@ if test "$GCC" = yes -a "$ICC" = no; then # These work in some but not all gcc versions save_CFLAGS=$CFLAGS PGAC_PROG_CC_CFLAGS_OPT([-Wdeclaration-after-statement]) + # Not applicable for C++ + PGAC_PROG_CC_CFLAGS_OPT([-Wold-style-definition]) # -Wdeclaration-after-statement isn't applicable for C++. Specific C files # disable it, so AC_SUBST the negative form. PERMIT_DECLARATION_AFTER_STATEMENT= -- 2.25.0.114.g5b0ca878e0 --zqfhnontb2zb7pps-- ^ permalink raw reply [nested|flat] 21+ messages in thread
* [PATCH] Add -Wold-style-definition to CFLAGS. @ 2020-05-09 17:38 Andres Freund <[email protected]> 0 siblings, 0 replies; 21+ messages in thread From: Andres Freund @ 2020-05-09 17:38 UTC (permalink / raw) Author: Reviewed-By: Discussion: https://postgr.es/m/ Backpatch: --- src/backend/postmaster/autovacuum.c | 2 +- src/backend/storage/buffer/freelist.c | 2 +- src/backend/utils/adt/jsonpath_scan.l | 2 +- src/backend/utils/misc/queryenvironment.c | 2 +- src/interfaces/libpq/fe-misc.c | 2 +- configure | 41 +++++++++++++++++++++++ configure.in | 2 ++ 7 files changed, 48 insertions(+), 5 deletions(-) diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index 7e97ffab27d..5641f59016d 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -834,7 +834,7 @@ HandleAutoVacLauncherInterrupts(void) * Perform a normal exit from the autovac launcher. */ static void -AutoVacLauncherShutdown() +AutoVacLauncherShutdown(void) { ereport(DEBUG1, (errmsg("autovacuum launcher shutting down"))); diff --git a/src/backend/storage/buffer/freelist.c b/src/backend/storage/buffer/freelist.c index aa5539a2e45..942f8d4edd2 100644 --- a/src/backend/storage/buffer/freelist.c +++ b/src/backend/storage/buffer/freelist.c @@ -177,7 +177,7 @@ ClockSweepTick(void) * should not call this. */ bool -have_free_buffer() +have_free_buffer(void) { if (StrategyControl->firstFreeBuffer >= 0) return true; diff --git a/src/backend/utils/adt/jsonpath_scan.l b/src/backend/utils/adt/jsonpath_scan.l index be0a2cfa2f7..df56a268d62 100644 --- a/src/backend/utils/adt/jsonpath_scan.l +++ b/src/backend/utils/adt/jsonpath_scan.l @@ -330,7 +330,7 @@ static const JsonPathKeyword keywords[] = { /* Check if current scanstring value is a keyword */ static enum yytokentype -checkKeyword() +checkKeyword(void) { int res = IDENT_P; int diff; diff --git a/src/backend/utils/misc/queryenvironment.c b/src/backend/utils/misc/queryenvironment.c index c0b85ed0b36..31de81f353e 100644 --- a/src/backend/utils/misc/queryenvironment.c +++ b/src/backend/utils/misc/queryenvironment.c @@ -36,7 +36,7 @@ struct QueryEnvironment QueryEnvironment * -create_queryEnv() +create_queryEnv(void) { return (QueryEnvironment *) palloc0(sizeof(QueryEnvironment)); } diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c index 19729f96311..9afa0533a62 100644 --- a/src/interfaces/libpq/fe-misc.c +++ b/src/interfaces/libpq/fe-misc.c @@ -1250,7 +1250,7 @@ PQenv2encoding(void) #ifdef ENABLE_NLS static void -libpq_binddomain() +libpq_binddomain(void) { static bool already_bound = false; diff --git a/configure b/configure index 83abe872aa6..b5bd3b2e9c0 100755 --- a/configure +++ b/configure @@ -5321,6 +5321,47 @@ if test x"$pgac_cv_prog_CC_cflags__Wdeclaration_after_statement" = x"yes"; then fi + # Not applicable for C++ + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wold-style-definition, for CFLAGS" >&5 +$as_echo_n "checking whether ${CC} supports -Wold-style-definition, for CFLAGS... " >&6; } +if ${pgac_cv_prog_CC_cflags__Wold_style_definition+:} false; then : + $as_echo_n "(cached) " >&6 +else + pgac_save_CFLAGS=$CFLAGS +pgac_save_CC=$CC +CC=${CC} +CFLAGS="${CFLAGS} -Wold-style-definition" +ac_save_c_werror_flag=$ac_c_werror_flag +ac_c_werror_flag=yes +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + pgac_cv_prog_CC_cflags__Wold_style_definition=yes +else + pgac_cv_prog_CC_cflags__Wold_style_definition=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_c_werror_flag=$ac_save_c_werror_flag +CFLAGS="$pgac_save_CFLAGS" +CC="$pgac_save_CC" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Wold_style_definition" >&5 +$as_echo "$pgac_cv_prog_CC_cflags__Wold_style_definition" >&6; } +if test x"$pgac_cv_prog_CC_cflags__Wold_style_definition" = x"yes"; then + CFLAGS="${CFLAGS} -Wold-style-definition" +fi + + # -Wdeclaration-after-statement isn't applicable for C++. Specific C files # disable it, so AC_SUBST the negative form. PERMIT_DECLARATION_AFTER_STATEMENT= diff --git a/configure.in b/configure.in index ecdf1723967..2b0a88ab911 100644 --- a/configure.in +++ b/configure.in @@ -482,6 +482,8 @@ if test "$GCC" = yes -a "$ICC" = no; then # These work in some but not all gcc versions save_CFLAGS=$CFLAGS PGAC_PROG_CC_CFLAGS_OPT([-Wdeclaration-after-statement]) + # Not applicable for C++ + PGAC_PROG_CC_CFLAGS_OPT([-Wold-style-definition]) # -Wdeclaration-after-statement isn't applicable for C++. Specific C files # disable it, so AC_SUBST the negative form. PERMIT_DECLARATION_AFTER_STATEMENT= -- 2.25.0.114.g5b0ca878e0 --zqfhnontb2zb7pps-- ^ permalink raw reply [nested|flat] 21+ messages in thread
* [PATCH] Add -Wold-style-definition to CFLAGS. @ 2020-05-09 17:38 Andres Freund <[email protected]> 0 siblings, 0 replies; 21+ messages in thread From: Andres Freund @ 2020-05-09 17:38 UTC (permalink / raw) Author: Reviewed-By: Discussion: https://postgr.es/m/ Backpatch: --- src/backend/postmaster/autovacuum.c | 2 +- src/backend/storage/buffer/freelist.c | 2 +- src/backend/utils/adt/jsonpath_scan.l | 2 +- src/backend/utils/misc/queryenvironment.c | 2 +- src/interfaces/libpq/fe-misc.c | 2 +- configure | 41 +++++++++++++++++++++++ configure.in | 2 ++ 7 files changed, 48 insertions(+), 5 deletions(-) diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index 7e97ffab27d..5641f59016d 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -834,7 +834,7 @@ HandleAutoVacLauncherInterrupts(void) * Perform a normal exit from the autovac launcher. */ static void -AutoVacLauncherShutdown() +AutoVacLauncherShutdown(void) { ereport(DEBUG1, (errmsg("autovacuum launcher shutting down"))); diff --git a/src/backend/storage/buffer/freelist.c b/src/backend/storage/buffer/freelist.c index aa5539a2e45..942f8d4edd2 100644 --- a/src/backend/storage/buffer/freelist.c +++ b/src/backend/storage/buffer/freelist.c @@ -177,7 +177,7 @@ ClockSweepTick(void) * should not call this. */ bool -have_free_buffer() +have_free_buffer(void) { if (StrategyControl->firstFreeBuffer >= 0) return true; diff --git a/src/backend/utils/adt/jsonpath_scan.l b/src/backend/utils/adt/jsonpath_scan.l index be0a2cfa2f7..df56a268d62 100644 --- a/src/backend/utils/adt/jsonpath_scan.l +++ b/src/backend/utils/adt/jsonpath_scan.l @@ -330,7 +330,7 @@ static const JsonPathKeyword keywords[] = { /* Check if current scanstring value is a keyword */ static enum yytokentype -checkKeyword() +checkKeyword(void) { int res = IDENT_P; int diff; diff --git a/src/backend/utils/misc/queryenvironment.c b/src/backend/utils/misc/queryenvironment.c index c0b85ed0b36..31de81f353e 100644 --- a/src/backend/utils/misc/queryenvironment.c +++ b/src/backend/utils/misc/queryenvironment.c @@ -36,7 +36,7 @@ struct QueryEnvironment QueryEnvironment * -create_queryEnv() +create_queryEnv(void) { return (QueryEnvironment *) palloc0(sizeof(QueryEnvironment)); } diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c index 19729f96311..9afa0533a62 100644 --- a/src/interfaces/libpq/fe-misc.c +++ b/src/interfaces/libpq/fe-misc.c @@ -1250,7 +1250,7 @@ PQenv2encoding(void) #ifdef ENABLE_NLS static void -libpq_binddomain() +libpq_binddomain(void) { static bool already_bound = false; diff --git a/configure b/configure index 83abe872aa6..b5bd3b2e9c0 100755 --- a/configure +++ b/configure @@ -5321,6 +5321,47 @@ if test x"$pgac_cv_prog_CC_cflags__Wdeclaration_after_statement" = x"yes"; then fi + # Not applicable for C++ + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wold-style-definition, for CFLAGS" >&5 +$as_echo_n "checking whether ${CC} supports -Wold-style-definition, for CFLAGS... " >&6; } +if ${pgac_cv_prog_CC_cflags__Wold_style_definition+:} false; then : + $as_echo_n "(cached) " >&6 +else + pgac_save_CFLAGS=$CFLAGS +pgac_save_CC=$CC +CC=${CC} +CFLAGS="${CFLAGS} -Wold-style-definition" +ac_save_c_werror_flag=$ac_c_werror_flag +ac_c_werror_flag=yes +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + pgac_cv_prog_CC_cflags__Wold_style_definition=yes +else + pgac_cv_prog_CC_cflags__Wold_style_definition=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_c_werror_flag=$ac_save_c_werror_flag +CFLAGS="$pgac_save_CFLAGS" +CC="$pgac_save_CC" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Wold_style_definition" >&5 +$as_echo "$pgac_cv_prog_CC_cflags__Wold_style_definition" >&6; } +if test x"$pgac_cv_prog_CC_cflags__Wold_style_definition" = x"yes"; then + CFLAGS="${CFLAGS} -Wold-style-definition" +fi + + # -Wdeclaration-after-statement isn't applicable for C++. Specific C files # disable it, so AC_SUBST the negative form. PERMIT_DECLARATION_AFTER_STATEMENT= diff --git a/configure.in b/configure.in index ecdf1723967..2b0a88ab911 100644 --- a/configure.in +++ b/configure.in @@ -482,6 +482,8 @@ if test "$GCC" = yes -a "$ICC" = no; then # These work in some but not all gcc versions save_CFLAGS=$CFLAGS PGAC_PROG_CC_CFLAGS_OPT([-Wdeclaration-after-statement]) + # Not applicable for C++ + PGAC_PROG_CC_CFLAGS_OPT([-Wold-style-definition]) # -Wdeclaration-after-statement isn't applicable for C++. Specific C files # disable it, so AC_SUBST the negative form. PERMIT_DECLARATION_AFTER_STATEMENT= -- 2.25.0.114.g5b0ca878e0 --zqfhnontb2zb7pps-- ^ permalink raw reply [nested|flat] 21+ messages in thread
* [PATCH] Add -Wold-style-definition to CFLAGS. @ 2020-05-09 17:38 Andres Freund <[email protected]> 0 siblings, 0 replies; 21+ messages in thread From: Andres Freund @ 2020-05-09 17:38 UTC (permalink / raw) Author: Reviewed-By: Discussion: https://postgr.es/m/ Backpatch: --- src/backend/postmaster/autovacuum.c | 2 +- src/backend/storage/buffer/freelist.c | 2 +- src/backend/utils/adt/jsonpath_scan.l | 2 +- src/backend/utils/misc/queryenvironment.c | 2 +- src/interfaces/libpq/fe-misc.c | 2 +- configure | 41 +++++++++++++++++++++++ configure.in | 2 ++ 7 files changed, 48 insertions(+), 5 deletions(-) diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index 7e97ffab27d..5641f59016d 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -834,7 +834,7 @@ HandleAutoVacLauncherInterrupts(void) * Perform a normal exit from the autovac launcher. */ static void -AutoVacLauncherShutdown() +AutoVacLauncherShutdown(void) { ereport(DEBUG1, (errmsg("autovacuum launcher shutting down"))); diff --git a/src/backend/storage/buffer/freelist.c b/src/backend/storage/buffer/freelist.c index aa5539a2e45..942f8d4edd2 100644 --- a/src/backend/storage/buffer/freelist.c +++ b/src/backend/storage/buffer/freelist.c @@ -177,7 +177,7 @@ ClockSweepTick(void) * should not call this. */ bool -have_free_buffer() +have_free_buffer(void) { if (StrategyControl->firstFreeBuffer >= 0) return true; diff --git a/src/backend/utils/adt/jsonpath_scan.l b/src/backend/utils/adt/jsonpath_scan.l index be0a2cfa2f7..df56a268d62 100644 --- a/src/backend/utils/adt/jsonpath_scan.l +++ b/src/backend/utils/adt/jsonpath_scan.l @@ -330,7 +330,7 @@ static const JsonPathKeyword keywords[] = { /* Check if current scanstring value is a keyword */ static enum yytokentype -checkKeyword() +checkKeyword(void) { int res = IDENT_P; int diff; diff --git a/src/backend/utils/misc/queryenvironment.c b/src/backend/utils/misc/queryenvironment.c index c0b85ed0b36..31de81f353e 100644 --- a/src/backend/utils/misc/queryenvironment.c +++ b/src/backend/utils/misc/queryenvironment.c @@ -36,7 +36,7 @@ struct QueryEnvironment QueryEnvironment * -create_queryEnv() +create_queryEnv(void) { return (QueryEnvironment *) palloc0(sizeof(QueryEnvironment)); } diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c index 19729f96311..9afa0533a62 100644 --- a/src/interfaces/libpq/fe-misc.c +++ b/src/interfaces/libpq/fe-misc.c @@ -1250,7 +1250,7 @@ PQenv2encoding(void) #ifdef ENABLE_NLS static void -libpq_binddomain() +libpq_binddomain(void) { static bool already_bound = false; diff --git a/configure b/configure index 83abe872aa6..b5bd3b2e9c0 100755 --- a/configure +++ b/configure @@ -5321,6 +5321,47 @@ if test x"$pgac_cv_prog_CC_cflags__Wdeclaration_after_statement" = x"yes"; then fi + # Not applicable for C++ + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wold-style-definition, for CFLAGS" >&5 +$as_echo_n "checking whether ${CC} supports -Wold-style-definition, for CFLAGS... " >&6; } +if ${pgac_cv_prog_CC_cflags__Wold_style_definition+:} false; then : + $as_echo_n "(cached) " >&6 +else + pgac_save_CFLAGS=$CFLAGS +pgac_save_CC=$CC +CC=${CC} +CFLAGS="${CFLAGS} -Wold-style-definition" +ac_save_c_werror_flag=$ac_c_werror_flag +ac_c_werror_flag=yes +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + pgac_cv_prog_CC_cflags__Wold_style_definition=yes +else + pgac_cv_prog_CC_cflags__Wold_style_definition=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_c_werror_flag=$ac_save_c_werror_flag +CFLAGS="$pgac_save_CFLAGS" +CC="$pgac_save_CC" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Wold_style_definition" >&5 +$as_echo "$pgac_cv_prog_CC_cflags__Wold_style_definition" >&6; } +if test x"$pgac_cv_prog_CC_cflags__Wold_style_definition" = x"yes"; then + CFLAGS="${CFLAGS} -Wold-style-definition" +fi + + # -Wdeclaration-after-statement isn't applicable for C++. Specific C files # disable it, so AC_SUBST the negative form. PERMIT_DECLARATION_AFTER_STATEMENT= diff --git a/configure.in b/configure.in index ecdf1723967..2b0a88ab911 100644 --- a/configure.in +++ b/configure.in @@ -482,6 +482,8 @@ if test "$GCC" = yes -a "$ICC" = no; then # These work in some but not all gcc versions save_CFLAGS=$CFLAGS PGAC_PROG_CC_CFLAGS_OPT([-Wdeclaration-after-statement]) + # Not applicable for C++ + PGAC_PROG_CC_CFLAGS_OPT([-Wold-style-definition]) # -Wdeclaration-after-statement isn't applicable for C++. Specific C files # disable it, so AC_SUBST the negative form. PERMIT_DECLARATION_AFTER_STATEMENT= -- 2.25.0.114.g5b0ca878e0 --zqfhnontb2zb7pps-- ^ permalink raw reply [nested|flat] 21+ messages in thread
* [PATCH] Add -Wold-style-definition to CFLAGS. @ 2020-05-09 17:38 Andres Freund <[email protected]> 0 siblings, 0 replies; 21+ messages in thread From: Andres Freund @ 2020-05-09 17:38 UTC (permalink / raw) Author: Reviewed-By: Discussion: https://postgr.es/m/ Backpatch: --- src/backend/postmaster/autovacuum.c | 2 +- src/backend/storage/buffer/freelist.c | 2 +- src/backend/utils/adt/jsonpath_scan.l | 2 +- src/backend/utils/misc/queryenvironment.c | 2 +- src/interfaces/libpq/fe-misc.c | 2 +- configure | 41 +++++++++++++++++++++++ configure.in | 2 ++ 7 files changed, 48 insertions(+), 5 deletions(-) diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index 7e97ffab27d..5641f59016d 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -834,7 +834,7 @@ HandleAutoVacLauncherInterrupts(void) * Perform a normal exit from the autovac launcher. */ static void -AutoVacLauncherShutdown() +AutoVacLauncherShutdown(void) { ereport(DEBUG1, (errmsg("autovacuum launcher shutting down"))); diff --git a/src/backend/storage/buffer/freelist.c b/src/backend/storage/buffer/freelist.c index aa5539a2e45..942f8d4edd2 100644 --- a/src/backend/storage/buffer/freelist.c +++ b/src/backend/storage/buffer/freelist.c @@ -177,7 +177,7 @@ ClockSweepTick(void) * should not call this. */ bool -have_free_buffer() +have_free_buffer(void) { if (StrategyControl->firstFreeBuffer >= 0) return true; diff --git a/src/backend/utils/adt/jsonpath_scan.l b/src/backend/utils/adt/jsonpath_scan.l index be0a2cfa2f7..df56a268d62 100644 --- a/src/backend/utils/adt/jsonpath_scan.l +++ b/src/backend/utils/adt/jsonpath_scan.l @@ -330,7 +330,7 @@ static const JsonPathKeyword keywords[] = { /* Check if current scanstring value is a keyword */ static enum yytokentype -checkKeyword() +checkKeyword(void) { int res = IDENT_P; int diff; diff --git a/src/backend/utils/misc/queryenvironment.c b/src/backend/utils/misc/queryenvironment.c index c0b85ed0b36..31de81f353e 100644 --- a/src/backend/utils/misc/queryenvironment.c +++ b/src/backend/utils/misc/queryenvironment.c @@ -36,7 +36,7 @@ struct QueryEnvironment QueryEnvironment * -create_queryEnv() +create_queryEnv(void) { return (QueryEnvironment *) palloc0(sizeof(QueryEnvironment)); } diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c index 19729f96311..9afa0533a62 100644 --- a/src/interfaces/libpq/fe-misc.c +++ b/src/interfaces/libpq/fe-misc.c @@ -1250,7 +1250,7 @@ PQenv2encoding(void) #ifdef ENABLE_NLS static void -libpq_binddomain() +libpq_binddomain(void) { static bool already_bound = false; diff --git a/configure b/configure index 83abe872aa6..b5bd3b2e9c0 100755 --- a/configure +++ b/configure @@ -5321,6 +5321,47 @@ if test x"$pgac_cv_prog_CC_cflags__Wdeclaration_after_statement" = x"yes"; then fi + # Not applicable for C++ + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wold-style-definition, for CFLAGS" >&5 +$as_echo_n "checking whether ${CC} supports -Wold-style-definition, for CFLAGS... " >&6; } +if ${pgac_cv_prog_CC_cflags__Wold_style_definition+:} false; then : + $as_echo_n "(cached) " >&6 +else + pgac_save_CFLAGS=$CFLAGS +pgac_save_CC=$CC +CC=${CC} +CFLAGS="${CFLAGS} -Wold-style-definition" +ac_save_c_werror_flag=$ac_c_werror_flag +ac_c_werror_flag=yes +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + pgac_cv_prog_CC_cflags__Wold_style_definition=yes +else + pgac_cv_prog_CC_cflags__Wold_style_definition=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_c_werror_flag=$ac_save_c_werror_flag +CFLAGS="$pgac_save_CFLAGS" +CC="$pgac_save_CC" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Wold_style_definition" >&5 +$as_echo "$pgac_cv_prog_CC_cflags__Wold_style_definition" >&6; } +if test x"$pgac_cv_prog_CC_cflags__Wold_style_definition" = x"yes"; then + CFLAGS="${CFLAGS} -Wold-style-definition" +fi + + # -Wdeclaration-after-statement isn't applicable for C++. Specific C files # disable it, so AC_SUBST the negative form. PERMIT_DECLARATION_AFTER_STATEMENT= diff --git a/configure.in b/configure.in index ecdf1723967..2b0a88ab911 100644 --- a/configure.in +++ b/configure.in @@ -482,6 +482,8 @@ if test "$GCC" = yes -a "$ICC" = no; then # These work in some but not all gcc versions save_CFLAGS=$CFLAGS PGAC_PROG_CC_CFLAGS_OPT([-Wdeclaration-after-statement]) + # Not applicable for C++ + PGAC_PROG_CC_CFLAGS_OPT([-Wold-style-definition]) # -Wdeclaration-after-statement isn't applicable for C++. Specific C files # disable it, so AC_SUBST the negative form. PERMIT_DECLARATION_AFTER_STATEMENT= -- 2.25.0.114.g5b0ca878e0 --zqfhnontb2zb7pps-- ^ permalink raw reply [nested|flat] 21+ messages in thread
* [PATCH] Add -Wold-style-definition to CFLAGS. @ 2020-05-09 17:38 Andres Freund <[email protected]> 0 siblings, 0 replies; 21+ messages in thread From: Andres Freund @ 2020-05-09 17:38 UTC (permalink / raw) Author: Reviewed-By: Discussion: https://postgr.es/m/ Backpatch: --- src/backend/postmaster/autovacuum.c | 2 +- src/backend/storage/buffer/freelist.c | 2 +- src/backend/utils/adt/jsonpath_scan.l | 2 +- src/backend/utils/misc/queryenvironment.c | 2 +- src/interfaces/libpq/fe-misc.c | 2 +- configure | 41 +++++++++++++++++++++++ configure.in | 2 ++ 7 files changed, 48 insertions(+), 5 deletions(-) diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c index 7e97ffab27d..5641f59016d 100644 --- a/src/backend/postmaster/autovacuum.c +++ b/src/backend/postmaster/autovacuum.c @@ -834,7 +834,7 @@ HandleAutoVacLauncherInterrupts(void) * Perform a normal exit from the autovac launcher. */ static void -AutoVacLauncherShutdown() +AutoVacLauncherShutdown(void) { ereport(DEBUG1, (errmsg("autovacuum launcher shutting down"))); diff --git a/src/backend/storage/buffer/freelist.c b/src/backend/storage/buffer/freelist.c index aa5539a2e45..942f8d4edd2 100644 --- a/src/backend/storage/buffer/freelist.c +++ b/src/backend/storage/buffer/freelist.c @@ -177,7 +177,7 @@ ClockSweepTick(void) * should not call this. */ bool -have_free_buffer() +have_free_buffer(void) { if (StrategyControl->firstFreeBuffer >= 0) return true; diff --git a/src/backend/utils/adt/jsonpath_scan.l b/src/backend/utils/adt/jsonpath_scan.l index be0a2cfa2f7..df56a268d62 100644 --- a/src/backend/utils/adt/jsonpath_scan.l +++ b/src/backend/utils/adt/jsonpath_scan.l @@ -330,7 +330,7 @@ static const JsonPathKeyword keywords[] = { /* Check if current scanstring value is a keyword */ static enum yytokentype -checkKeyword() +checkKeyword(void) { int res = IDENT_P; int diff; diff --git a/src/backend/utils/misc/queryenvironment.c b/src/backend/utils/misc/queryenvironment.c index c0b85ed0b36..31de81f353e 100644 --- a/src/backend/utils/misc/queryenvironment.c +++ b/src/backend/utils/misc/queryenvironment.c @@ -36,7 +36,7 @@ struct QueryEnvironment QueryEnvironment * -create_queryEnv() +create_queryEnv(void) { return (QueryEnvironment *) palloc0(sizeof(QueryEnvironment)); } diff --git a/src/interfaces/libpq/fe-misc.c b/src/interfaces/libpq/fe-misc.c index 19729f96311..9afa0533a62 100644 --- a/src/interfaces/libpq/fe-misc.c +++ b/src/interfaces/libpq/fe-misc.c @@ -1250,7 +1250,7 @@ PQenv2encoding(void) #ifdef ENABLE_NLS static void -libpq_binddomain() +libpq_binddomain(void) { static bool already_bound = false; diff --git a/configure b/configure index 83abe872aa6..b5bd3b2e9c0 100755 --- a/configure +++ b/configure @@ -5321,6 +5321,47 @@ if test x"$pgac_cv_prog_CC_cflags__Wdeclaration_after_statement" = x"yes"; then fi + # Not applicable for C++ + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${CC} supports -Wold-style-definition, for CFLAGS" >&5 +$as_echo_n "checking whether ${CC} supports -Wold-style-definition, for CFLAGS... " >&6; } +if ${pgac_cv_prog_CC_cflags__Wold_style_definition+:} false; then : + $as_echo_n "(cached) " >&6 +else + pgac_save_CFLAGS=$CFLAGS +pgac_save_CC=$CC +CC=${CC} +CFLAGS="${CFLAGS} -Wold-style-definition" +ac_save_c_werror_flag=$ac_c_werror_flag +ac_c_werror_flag=yes +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + pgac_cv_prog_CC_cflags__Wold_style_definition=yes +else + pgac_cv_prog_CC_cflags__Wold_style_definition=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +ac_c_werror_flag=$ac_save_c_werror_flag +CFLAGS="$pgac_save_CFLAGS" +CC="$pgac_save_CC" +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv_prog_CC_cflags__Wold_style_definition" >&5 +$as_echo "$pgac_cv_prog_CC_cflags__Wold_style_definition" >&6; } +if test x"$pgac_cv_prog_CC_cflags__Wold_style_definition" = x"yes"; then + CFLAGS="${CFLAGS} -Wold-style-definition" +fi + + # -Wdeclaration-after-statement isn't applicable for C++. Specific C files # disable it, so AC_SUBST the negative form. PERMIT_DECLARATION_AFTER_STATEMENT= diff --git a/configure.in b/configure.in index ecdf1723967..2b0a88ab911 100644 --- a/configure.in +++ b/configure.in @@ -482,6 +482,8 @@ if test "$GCC" = yes -a "$ICC" = no; then # These work in some but not all gcc versions save_CFLAGS=$CFLAGS PGAC_PROG_CC_CFLAGS_OPT([-Wdeclaration-after-statement]) + # Not applicable for C++ + PGAC_PROG_CC_CFLAGS_OPT([-Wold-style-definition]) # -Wdeclaration-after-statement isn't applicable for C++. Specific C files # disable it, so AC_SUBST the negative form. PERMIT_DECLARATION_AFTER_STATEMENT= -- 2.25.0.114.g5b0ca878e0 --zqfhnontb2zb7pps-- ^ permalink raw reply [nested|flat] 21+ messages in thread
* Re: Comment in preptlist.c @ 2023-03-21 14:01 Tom Lane <[email protected]> 0 siblings, 0 replies; 21+ messages in thread From: Tom Lane @ 2023-03-21 14:01 UTC (permalink / raw) To: Etsuro Fujita <[email protected]>; +Cc: PostgreSQL Hackers <[email protected]> Etsuro Fujita <[email protected]> writes: > While working on something else, I noticed $SUBJECT added by commit 86dc90056: > * For UPDATE and DELETE queries, the targetlist must also contain "junk" > * tlist entries needed to allow the executor to identify the rows to be > * updated or deleted; for example, the ctid of a heap row. (The planner > * adds these; they're not in what we receive from the planner/rewriter.) > I think that “planner/rewriter” should be parser/rewriter. Attached > is a patch for that. Agreed, obviously a thinko :-( regards, tom lane ^ permalink raw reply [nested|flat] 21+ messages in thread
end of thread, other threads:[~2023-03-21 14:01 UTC | newest] Thread overview: 21+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2020-05-09 17:38 [PATCH] Add -Wold-style-definition to CFLAGS. Andres Freund <[email protected]> 2020-05-09 17:38 [PATCH] Add -Wold-style-definition to CFLAGS. Andres Freund <[email protected]> 2020-05-09 17:38 [PATCH] Add -Wold-style-definition to CFLAGS. Andres Freund <[email protected]> 2020-05-09 17:38 [PATCH] Add -Wold-style-definition to CFLAGS. Andres Freund <[email protected]> 2020-05-09 17:38 [PATCH] Add -Wold-style-definition to CFLAGS. Andres Freund <[email protected]> 2020-05-09 17:38 [PATCH] Add -Wold-style-definition to CFLAGS. Andres Freund <[email protected]> 2020-05-09 17:38 [PATCH] Add -Wold-style-definition to CFLAGS. Andres Freund <[email protected]> 2020-05-09 17:38 [PATCH] Add -Wold-style-definition to CFLAGS. Andres Freund <[email protected]> 2020-05-09 17:38 [PATCH] Add -Wold-style-definition to CFLAGS. Andres Freund <[email protected]> 2020-05-09 17:38 [PATCH] Add -Wold-style-definition to CFLAGS. Andres Freund <[email protected]> 2020-05-09 17:38 [PATCH] Add -Wold-style-definition to CFLAGS. Andres Freund <[email protected]> 2020-05-09 17:38 [PATCH] Add -Wold-style-definition to CFLAGS. Andres Freund <[email protected]> 2020-05-09 17:38 [PATCH] Add -Wold-style-definition to CFLAGS. Andres Freund <[email protected]> 2020-05-09 17:38 [PATCH] Add -Wold-style-definition to CFLAGS. Andres Freund <[email protected]> 2020-05-09 17:38 [PATCH] Add -Wold-style-definition to CFLAGS. Andres Freund <[email protected]> 2020-05-09 17:38 [PATCH] Add -Wold-style-definition to CFLAGS. Andres Freund <[email protected]> 2020-05-09 17:38 [PATCH] Add -Wold-style-definition to CFLAGS. Andres Freund <[email protected]> 2020-05-09 17:38 [PATCH] Add -Wold-style-definition to CFLAGS. Andres Freund <[email protected]> 2020-05-09 17:38 [PATCH] Add -Wold-style-definition to CFLAGS. Andres Freund <[email protected]> 2020-05-09 17:38 [PATCH] Add -Wold-style-definition to CFLAGS. Andres Freund <[email protected]> 2023-03-21 14:01 Re: Comment in preptlist.c Tom Lane <[email protected]>
This inbox is served by agora; see mirroring instructions for how to clone and mirror all data and code used for this inbox