Re: [PATCH] warn-access: Fix up check_pointer_uses [PR104715]

2022-03-02 Thread Jakub Jelinek via Gcc-patches
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

Re: [PATCH] warn-access: Fix up check_pointer_uses [PR104715]

2022-03-01 Thread Richard Biener via Gcc-patches
> Am 01.03.2022 um 20:08 schrieb Martin Sebor via Gcc-patches > : > > On 3/1/22 11:41, Jakub Jelinek wrote: >> Hi! >> The following testcase emits bogus -Wdangling-pointer warnings. >> The bug is that when it sees that ptr immediate use is a call that >> returns one of its arguments, it will

Re: [PATCH] warn-access: Fix up check_pointer_uses [PR104715]

2022-03-01 Thread Martin Sebor via Gcc-patches
On 3/1/22 11:41, Jakub Jelinek wrote: Hi! The following testcase emits bogus -Wdangling-pointer warnings. The bug is that when it sees that ptr immediate use is a call that returns one of its arguments, it will assume that the return value is based on ptr, but that is the case only if ptr is pas

[PATCH] warn-access: Fix up check_pointer_uses [PR104715]

2022-03-01 Thread Jakub Jelinek via Gcc-patches
Hi! The following testcase emits bogus -Wdangling-pointer warnings. The bug is that when it sees that ptr immediate use is a call that returns one of its arguments, it will assume that the return value is based on ptr, but that is the case only if ptr is passed to the argument that is actually ret