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