https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96003
Nadav Har'El <nyh at math dot technion.ac.il> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nyh at math dot technion.ac.il --- Comment #27 from Nadav Har'El <nyh at math dot technion.ac.il> --- I think this problem still exists at least in some form, and should be reopened. It just hit the Seastar project, with gcc 11.1.1 - https://github.com/scylladb/seastar/issues/914. The problem there is that it uses C-style callbacks (of the c-ares library) that cannot be modified; The callback gets a void* argument. We pass a C++'s object's address into this void*, and then inside the callback function itself, cast the void* back (using reinterpret_cast) to the object pointer - and then attempt to run methods of this pointer. Here is where gcc 11.1.1. warns us that this pointer may be a null (the message erroneously says "is a null") - although I know for a fact it cannot be a null, and sadly even adding an assert(p) to tell the compiler I'm sure it is not a null - doesn't help.