From c5ff163d53f1e9c1b647c4bf413386015ac4be71 Mon Sep 17 00:00:00 2001 From: Ozan Tezcan Date: Sun, 14 Aug 2022 14:29:05 +0300 Subject: Fix Lua compile warning on GCC 12.1 (#11115) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix Lua compile warning on GCC 12.1 GCC 12.1 prints a warning on compile: ``` ldump.c: In function ‘DumpString’: ldump.c:63:26: warning: the comparison will always evaluate as ‘false’ for the pointer operand in ‘s + 24’ must not be NULL [-Waddress] 63 | if (s==NULL || getstr(s)==NULL) ``` It seems correct, `getstr(s)` can't be `NULL`. Also, I see Lua v5.2 does not have that check: https://github.com/lua/lua/blob/v5-2/ldump.c#L63 --- deps/lua/src/ldump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'deps') diff --git a/deps/lua/src/ldump.c b/deps/lua/src/ldump.c index c9d3d4870..b69a12729 100644 --- a/deps/lua/src/ldump.c +++ b/deps/lua/src/ldump.c @@ -60,7 +60,7 @@ static void DumpVector(const void* b, int n, size_t size, DumpState* D) static void DumpString(const TString* s, DumpState* D) { - if (s==NULL || getstr(s)==NULL) + if (s==NULL) { size_t size=0; DumpVar(size,D); -- cgit v1.2.1