commit 08059713a94e7dffca071f84a936ee7124a77c27
parent abfe775537fe006c4bac13092c007844d209ab92
Author: Jared Tobin <jared@jtobin.io>
Date: Sun, 24 May 2026 17:22:40 -0230
silence CApiFFI pointer-type warnings on clang 15+
For each `foreign import capi` declaration over an opaque
struct (`Ptr (Ptr MDB_env)` etc.), GHC emits a tiny wrapper:
HsInt32 ghczuwrapper...(void** a1) { return mdb_env_create(a1); }
clang 15+ flags the `void**` -> `MDB_env**` conversion under
-Wincompatible-pointer-types, and GHC prints those warnings
wrapped in its own diagnostic format ("error: warning: ...").
The build still succeeds, but the output is noisy and reads as
if it's failing.
Add `-optc-Wno-incompatible-pointer-types` so the warning is
suppressed for the wrapper compilation. Doesn't touch our own
C (already silenced via `cc-options: -w`) or our Haskell.
Diffstat:
1 file changed, 1 insertion(+), 0 deletions(-)
diff --git a/ppad-lmdb.cabal b/ppad-lmdb.cabal
@@ -40,6 +40,7 @@ library
cc-options: -w
ghc-options:
-Wall
+ -optc-Wno-incompatible-pointer-types
if flag(llvm)
ghc-options: -fllvm -O2
if !os(windows)