Re: [PATCH] warn for more impossible null pointer tests [PR102103]

2021-09-22 Thread Jason Merrill via Gcc-patches
On 9/21/21 20:34, Martin Sebor wrote: On 9/21/21 3:40 PM, Jason Merrill wrote: On 9/17/21 12:02, Martin Sebor wrote: On 9/8/21 2:06 PM, Jason Merrill wrote: On 9/2/21 7:53 PM, Martin Sebor wrote: @@ -4622,28 +4622,94 @@ warn_for_null_address (location_t location, tree op, tsubst_flags_t compl

Re: [PATCH] warn for more impossible null pointer tests [PR102103]

2021-09-21 Thread Martin Sebor via Gcc-patches
On 9/21/21 3:40 PM, Jason Merrill wrote: On 9/17/21 12:02, Martin Sebor wrote: On 9/8/21 2:06 PM, Jason Merrill wrote: On 9/2/21 7:53 PM, Martin Sebor wrote: @@ -4622,28 +4622,94 @@ warn_for_null_address (location_t location, tree op, tsubst_flags_t complain)     if (!warn_address     ||

Re: [PATCH] warn for more impossible null pointer tests [PR102103]

2021-09-21 Thread Jason Merrill via Gcc-patches
On 9/17/21 12:02, Martin Sebor wrote: On 9/8/21 2:06 PM, Jason Merrill wrote: On 9/2/21 7:53 PM, Martin Sebor wrote: @@ -4622,28 +4622,94 @@ warn_for_null_address (location_t location, tree op, tsubst_flags_t complain)     if (!warn_address     || (complain & tf_warning) == 0     || c_

Re: [PATCH] warn for more impossible null pointer tests [PR102103]

2021-09-17 Thread Martin Sebor via Gcc-patches
On 9/8/21 2:06 PM, Jason Merrill wrote: On 9/2/21 7:53 PM, Martin Sebor wrote: @@ -4622,28 +4622,94 @@ warn_for_null_address (location_t location, tree op, tsubst_flags_t complain)     if (!warn_address     || (complain & tf_warning) == 0     || c_inhibit_evaluation_warnings != 0 - 

Re: [PATCH] warn for more impossible null pointer tests [PR102103]

2021-09-08 Thread Jason Merrill via Gcc-patches
On 9/2/21 7:53 PM, Martin Sebor wrote: @@ -4622,28 +4622,94 @@ warn_for_null_address (location_t location, tree op, tsubst_flags_t complain) if (!warn_address || (complain & tf_warning) == 0 || c_inhibit_evaluation_warnings != 0 - || warning_suppressed_p (op, OPT_Waddres

Re: [PATCH] warn for more impossible null pointer tests [PR102103]

2021-09-02 Thread Martin Sebor via Gcc-patches
Attached is an updated patch with Jason's suggested change to use handled_component_p(), retested on x86_64-linux and with Glibc. Adding more tests led to more changes but hopefully also a better end result. I've changed the warning suppression from a cast to void* to one to intptr_t, in part bec