On Tue, Mar 01, 2022 at 12:07:49PM -0700, Martin Sebor wrote: > Thanks for the fix. It makes sense to me. Besides the test for > the false positives I would suggest to add one to verify that using > the first argument to a strstr() call is diagnosed if it's dangling > (both as is, as well as with an offset from the first element). > There are tests for memchr and strchr in the -Wdangling-pointer > test suite but none for strstr.
Thanks for adding that test. Note, as I wrote in the PR, I think we should handle BUILT_IN_STRPBRK like BUILT_IN_STRSTR in pass_waccess::gimple_call_return_arg, but as that would emit further warnings, I think that has to be a GCC 13 material. Jakub