From 9e6d1d789e9b87dc42890ac2ed44a6c3d45f3e61 Mon Sep 17 00:00:00 2001 From: Mohamed Gaber Date: Mon, 4 Dec 2023 17:10:11 +0200 Subject: [PATCH] More explicit pointer truthiness check `magic/database/DBio.c::DBOpenOnly` calls `dbReadOpen(CellDef *, bool, bool, int)` with a pointer for the second argument. While technically valid C, newer compilers (Clang 16) have recently frowned upon implicit pointer-to-int conversion, requiring the flag `-Wno-int-conversion` or else an error is raised. Given that there is one such instance in the codebase, I think fixing it would be the simplest solution. --- database/DBio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/database/DBio.c b/database/DBio.c index e51dc5d1..108edc68 100644 --- a/database/DBio.c +++ b/database/DBio.c @@ -1577,7 +1577,7 @@ DBOpenOnly(cellDef, name, setFileName, errptr) */ int *errptr; /* Pointer to int to hold error value */ { - dbReadOpen(cellDef, name, setFileName, FALSE, errptr); + dbReadOpen(cellDef, name != NULL, setFileName, FALSE, errptr); } /*