On Wed, Apr 27, 2022 at 09:29:21AM +0200, Jakub Jelinek via Gcc-patches wrote:
> I'd say the right thing would be to keep the -Wuse-after-free= stuff as is
> and just adjust
> -  if ((maybe && warn_dangling_pointer < 2)
> +  if ((equality && warn_dangling_pointer < 3)
> +      || (maybe && warn_dangling_pointer < 2)
>        || warning_suppressed_p (use_stmt, OPT_Wdangling_pointer_))
>      return;
> i.e. basically introduce -Wdangling-pointer=3 level.  That would need

Or, if the intent is what you've documented that equality comparisons
are never warned about, then just if (equality || (maybe && ...
But I think the extra warning level might be better especially if we
document that the level can have many false positives and explain why.
But if somebody is willing to go through the false positives to find
some needle in the haystack, let it be his choice.

        Jakub

Reply via email to