[Bug c/81453] relational expression involving null pointer not diagnosed with -Wall
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Jan 11 00:31:43 GMT 2022
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81453
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |patch
--- Comment #4 from Martin Sebor <msebor at gcc dot gnu.org> ---
I'm not sure pr103945 is a duplicate of this feature request: this one is about
relational expressions involving a null pointer, while pr103945 is about
relational expressions involving function pointers. Both sets of expressions
are invalid, but both are also quite different.
That said, as I mentioned in bug 103945 comment 4: the patch I submitted in
October 2020 detects invalid relational comparisons of unrelated pointers of
all kinds (https://gcc.gnu.org/pipermail/gcc-patches/2020-November/558775.html;
the patch review was never finished). I'd expect it to also diagnose
relational expressions involving null pointers (because they're treated as
distinct by the pointer-query infrastructure) but I don't see any tests for it,
More information about the Gcc-bugs
mailing list