]> git.ipfire.org Git - thirdparty/git.git/commitdiff
nedmalloc: avoid new compile error
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Tue, 24 May 2022 00:23:04 +0000 (00:23 +0000)
committerJohannes Schindelin <johannes.schindelin@gmx.de>
Sun, 12 Mar 2023 19:31:53 +0000 (20:31 +0100)
GCC v12.x complains thusly:

compat/nedmalloc/nedmalloc.c: In function 'DestroyCaches':
compat/nedmalloc/nedmalloc.c:326:12: error: the comparison will always
                              evaluate as 'true' for the address of 'caches'
                              will never be NULL [-Werror=address]
  326 |         if(p->caches)
      |            ^
compat/nedmalloc/nedmalloc.c:196:22: note: 'caches' declared here
  196 |         threadcache *caches[THREADCACHEMAXCACHES];
      |                      ^~~~~~

... and it is correct, of course.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/nedmalloc/nedmalloc.c

index 1cc31c350223b84cd97939afccf1bcc1caa070b4..141c30f07f07c05f1584d1108b606989fc66c561 100644 (file)
@@ -323,7 +323,6 @@ static NOINLINE void RemoveCacheEntries(nedpool *p, threadcache *tc, unsigned in
 }
 static void DestroyCaches(nedpool *p) THROWSPEC
 {
-       if(p->caches)
        {
                threadcache *tc;
                int n;