Re: consider -Wmissing-variable-declarations

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter(at)eisentraut(dot)org>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: consider -Wmissing-variable-declarations
Date: 2026-02-21 18:31:25
Message-ID: 3109540.1771698685@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter Eisentraut <peter(at)eisentraut(dot)org> writes:
> On 03.08.24 22:46, Tom Lane wrote:
>> Various buildfarm animals are complaining about
>> g++: error: unrecognized command line option "-Wmissing-variable-declarations"; did you mean "-Wmissing-declarations"?
>> It looks like we are passing CFLAGS not CXXFLAGS to this particular
>> g++ invocation.

> Changing this seems to have done the trick.

I noticed that relatively-new BF animal siren has been failing build
in the pre-v18 branches, with symptoms very much like the above:

g++ -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Werror=unguarded-availability-new -Wendif-labels -Wmissing-format-attribute -Wcast-function-type -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-unused-command-line-argument -Wno-compound-token-split-by-macro -Wno-cast-function-type-strict -g -O2 -Wno-deprecated-declarations -fPIC -fvisibility=hidden -shared -o llvmjit.so llvmjit.o llvmjit_error.o llvmjit_inline.o llvmjit_wrap.o SectionMemoryManager.o llvmjit_deform.o llvmjit_expr.o -L../../../../src/port -L../../../../src/common -Wl,--as-needed -Wl,-rpath,'/home/linux1/20-siren/buildroot/REL_17_STABLE/inst/lib',--enable-new-dtags -fvisibility=hidden -L/usr/lib64 -lLLVM
g++: error: unrecognized command line option "-Wcast-function-type"; did you mean "-Wbad-function-cast"?

Evidently this is because 365b5a345 was not back-patched, so we're
passing CFLAGS selected for clang to g++.

I certainly wouldn't suggest that this is worth breaking release
freeze for, but I think we should back-patch once the freeze
is over.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Curtis 2026-02-21 21:15:32 Re: Fix race condition in SSI when reading PredXact->SxactGlobalXmin
Previous Message Andrew Dunstan 2026-02-21 18:16:05 Re: getting "shell command argument contains a newline or carriage return:" error with pg_dumpall when db name have new line in double quote