Skip to content

Commit c5ff163

Browse files
authored
Fix Lua compile warning on GCC 12.1 (redis#11115)
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
1 parent 8aad2ac commit c5ff163

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

deps/lua/src/ldump.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static void DumpVector(const void* b, int n, size_t size, DumpState* D)
6060

6161
static void DumpString(const TString* s, DumpState* D)
6262
{
63-
if (s==NULL || getstr(s)==NULL)
63+
if (s==NULL)
6464
{
6565
size_t size=0;
6666
DumpVar(size,D);

0 commit comments

Comments
 (0)