BUILD: pools: silence build warnings with DEBUG_MEMORY_POOLS and DEBUG_UAF
authorWilly Tarreau <w@1wt.eu>
Sat, 14 Mar 2020 10:08:16 +0000 (11:08 +0100)
committerWilly Tarreau <w@1wt.eu>
Sat, 14 Mar 2020 10:10:21 +0000 (11:10 +0100)
commite4d42551bd7a09b1ab0ed0919d8e286a5edfc85a
tree52539bda2786351b9b9972091d6fc34f593133eb
parent2e8ab6b5600c7b312d13178f1285b766eaae5fcb
BUILD: pools: silence build warnings with DEBUG_MEMORY_POOLS and DEBUG_UAF

With these debug options we still get these warnings:

include/common/memory.h:501:23: warning: null pointer dereference [-Wnull-dereference]
    *(volatile int *)0 = 0;
    ~~~~~~~~~~~~~~~~~~~^~~
include/common/memory.h:460:22: warning: null pointer dereference [-Wnull-dereference]
   *(volatile int *)0 = 0;
   ~~~~~~~~~~~~~~~~~~~^~~

These are purposely there to crash the process at specific locations.
But the annoying warnings do not help with debugging and they are not
even reliable as the compiler may decide to optimize them away. Let's
pass the pointer through DISGUISE() to avoid this.
include/common/memory.h