Re: GCC 8 warnings

From: Andres Freund <andres(at)anarazel(dot)de>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Devrim Gündüz <devrim(at)gunduz(dot)org>, pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: GCC 8 warnings
Date: 2018-06-16 18:52:18
Message-ID: 20180616185218.pmjuo4daom62qdn6@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2018-06-16 13:29:55 -0400, Tom Lane wrote:
> I propose the attached patch to disable these warnings if the compiler
> knows the switch for them. I did not turn them off for CXX though;
> anyone think there's a need to?

No, not for now. I don't think it's likely that the amount of C++ will
grow significantly anytime soon. And it seems unlikely that the llvm
interfacing code will use C stringops. Not that I think it'd hurt much
to add it.

> Probably all of this ought to be back-patched as applicable, since
> people will doubtless try to compile back branches with gcc 8.

Yea, It's already pretty annoying.

> diff --git a/configure.in b/configure.in
> index 862d8b128d..dae29a4ab1 100644
> --- a/configure.in
> +++ b/configure.in
> @@ -502,6 +502,15 @@ if test "$GCC" = yes -a "$ICC" = no; then
> if test -n "$NOT_THE_CFLAGS"; then
> CFLAGS="$CFLAGS -Wno-unused-command-line-argument"
> fi
> + # Similarly disable useless truncation warnings from gcc 8+
> + PGAC_PROG_CC_VAR_OPT(NOT_THE_CFLAGS, [-Wformat-truncation])
> + if test -n "$NOT_THE_CFLAGS"; then
> + CFLAGS="$CFLAGS -Wno-format-truncation"
> + fi
> + PGAC_PROG_CC_VAR_OPT(NOT_THE_CFLAGS, [-Wstringop-truncation])
> + if test -n "$NOT_THE_CFLAGS"; then
> + CFLAGS="$CFLAGS -Wno-stringop-truncation"
> + fi

I've not had a lot of coffee yet this morning, but couldn't there be an
issue where a compiler supported one of these flags? Because
NOT_THE_CFLAGS is reused, it'd trigger lateron as well, right? Seems to
me we'd need to reset it.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-06-16 19:00:11 Re: GCC 8 warnings
Previous Message Tom Lane 2018-06-16 17:29:55 Re: GCC 8 warnings