Subject: Compiler warning on Debian 12, PostgreSQL 16 Beta3

From: "Daniel Westermann (DWE)" <[email-masked]>
Date: Fri, 25 Aug 2023 05:36:12 +0000

Hi,

I've just noticed this warning when building on Debian 12:

In file included from /usr/lib/llvm-14/include/llvm/Analysis/ModuleSummaryAnalysis.h:17,
                 from llvmjit_inline.cpp:51:
/usr/lib/llvm-14/include/llvm/IR/ModuleSummaryIndex.h: In constructor ‘llvm::ModuleSummaryIndex::ModuleSummaryIndex(bool, bool)’:
/usr/lib/llvm-14/include/llvm/IR/ModuleSummaryIndex.h:1175:73: warning: member ‘llvm::ModuleSummaryIndex::Alloc’ is used uninitialized [-Wuninitialized]
 1175 |       : HaveGVs(HaveGVs), EnableSplitLTOUnit(EnableSplitLTOUnit), Saver(Alloc),
      |                    

cat /etc/debian_version 
12.1

Regards
Daniel

---

From: Alvaro Herrera <[email-masked]>
Date: Tue, 7 Nov 2023 16:46:53 +0100

>  1175 |       : HaveGVs(HaveGVs), EnableSplitLTOUnit(EnableSplitLTOUnit), Saver(Alloc),

Yeah, I get this one too.  I thought commit 37d5babb5cfa ("jit: Support
opaque pointers in LLVM 16.") was going to silence it, but I was quite
mistaken.  I gave that code a quick look and could not understand what
it was complaining about.  Is it a bug in the LLVM headers?

Adding Andres and Thomas to CC, because they're the ones touching the
LLVM / JIT code.

Any clues?

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/

---

From: Thomas Munro <[email-masked]>
Date: Wed, 8 Nov 2023 07:56:07 +1300

> it was complaining about.  Is it a bug in the LLVM headers?

I found the commit where they fixed that in 15+:

https://github.com/llvm/llvm-project/commit/1d9086bf054c2e734940620d02d4451156b424e6

They don't seem to back-patch fixes, generally.