diff --git a/configure b/configure index 7eb10fe90c1570561376d5e8e797b3a0d167d56d..3c4be397e95e908098e306c233aa087b2776b9e1 100755 --- a/configure +++ b/configure @@ -4233,9 +4233,9 @@ fi # but has its own. Also check other compiler-specific flags here. if test "$GCC" = yes -a "$ICC" = no; then - CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wpointer-arith " + CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wpointer-arith" # These work in some but not all gcc versions - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wendif-labels" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wendif-labels" >&5 $as_echo_n "checking if $CC supports -Wendif-labels... " >&6; } pgac_save_CFLAGS=$CFLAGS CFLAGS="$pgac_save_CFLAGS -Wendif-labels" @@ -4260,7 +4260,7 @@ $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - #PGAC_PROG_CC_CFLAGS_OPT([-Wmissing-format-attribute]) + #PGAC_PROG_CC_CFLAGS_OPT([-Wmissing-format-attribute]) # This was included in -Wall/-Wformat in older GCC versions { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wformat-security" >&5 $as_echo_n "checking if $CC supports -Wformat-security... " >&6; } @@ -4392,6 +4392,64 @@ $as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + # Silence compiler warnings that you get with modern versions of GCC. + # All of these warnings have been fixed in later versions of PostgreSQL, + # but GPDB is based on 8.2, so you get these. TODO: Remove when we catch up + # with later PostgreSQL releases. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wno-unused-but-set-variable" >&5 +$as_echo_n "checking if $CC supports -Wno-unused-but-set-variable... " >&6; } +pgac_save_CFLAGS=$CFLAGS +CFLAGS="$pgac_save_CFLAGS -Wno-unused-but-set-variable" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + CFLAGS="$pgac_save_CFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wno-address" >&5 +$as_echo_n "checking if $CC supports -Wno-address... " >&6; } +pgac_save_CFLAGS=$CFLAGS +CFLAGS="$pgac_save_CFLAGS -Wno-address" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } +else + CFLAGS="$pgac_save_CFLAGS" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + + + #-Wno-error=enum-compare -Wno-error=address -Wno-error=maybe-uninitialized + elif test "$ICC" = yes; then # Intel's compiler has a bug/misoptimization in checking for # division by NAN (NaN == 0), -mp1 fixes it, so add it to the CFLAGS. diff --git a/configure.in b/configure.in index 70d05ac850fbc249f1964a0637194deee4bf534c..02d032c61f3ce8b4d93fc7db0ba25d95510ea507 100644 --- a/configure.in +++ b/configure.in @@ -331,10 +331,10 @@ fi # but has its own. Also check other compiler-specific flags here. if test "$GCC" = yes -a "$ICC" = no; then - CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wpointer-arith " + CFLAGS="$CFLAGS -Wall -Wmissing-prototypes -Wpointer-arith" # These work in some but not all gcc versions - PGAC_PROG_CC_CFLAGS_OPT([-Wendif-labels]) - #PGAC_PROG_CC_CFLAGS_OPT([-Wmissing-format-attribute]) + PGAC_PROG_CC_CFLAGS_OPT([-Wendif-labels]) + #PGAC_PROG_CC_CFLAGS_OPT([-Wmissing-format-attribute]) # This was included in -Wall/-Wformat in older GCC versions PGAC_PROG_CC_CFLAGS_OPT([-Wformat-security]) # Disable strict-aliasing rules; needed for gcc 3.3+ @@ -346,6 +346,16 @@ if test "$GCC" = yes -a "$ICC" = no; then # Disable loop optimizations that get confused by variable-length struct # declarations in gcc 4.8+ PGAC_PROG_CC_CFLAGS_OPT([-fno-aggressive-loop-optimizations]) + + # Silence compiler warnings that you get with modern versions of GCC. + # All of these warnings have been fixed in later versions of PostgreSQL, + # but GPDB is based on 8.2, so you get these. TODO: Remove when we catch up + # with later PostgreSQL releases. + PGAC_PROG_CC_CFLAGS_OPT([-Wno-unused-but-set-variable]) + PGAC_PROG_CC_CFLAGS_OPT([-Wno-address]) + + #-Wno-error=enum-compare -Wno-error=address -Wno-error=maybe-uninitialized + elif test "$ICC" = yes; then # Intel's compiler has a bug/misoptimization in checking for # division by NAN (NaN == 0), -mp1 fixes it, so add it to the CFLAGS. diff --git a/src/Makefile.global.in b/src/Makefile.global.in index 66daed36b83d6776efed6bfb0ff8367dfb2285c2..6e60c20eb8b42620792f4f300037dca10c9fa895 100644 --- a/src/Makefile.global.in +++ b/src/Makefile.global.in @@ -234,12 +234,6 @@ GCC = @GCC@ SUN_STUDIO_CC = @SUN_STUDIO_CC@ CFLAGS = @CFLAGS@ -ifneq ($(findstring mingw32,$(CC)),mingw32) -ifeq ($(GCC), yes) - CFLAGS += -Werror -endif # GCC -endif - # Kind-of compilers BISON = @BISON@