]> 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)
committerJunio C Hamano <gitster@pobox.com>
Tue, 24 May 2022 22:58:31 +0000 (15:58 -0700)
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 edb438a7776aed1c1559352ce3b32e051cac806a..2c0ace7075a34e43b929e91a5c1ffcffe4d135b5 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;