Re: [Dnsmasq-discuss] cache.c:1683:30: warning: pointer used after ‘free’

2022-08-15 Thread Simon Kelley
On 14/08/2022 19:36, Geert Stappers via Dnsmasq-discuss wrote: On Fri, Aug 12, 2022 at 06:46:14PM +0100, Simon Kelley wrote: ... Does your compiler still complain? Nope OK. Problem solved. Looks like gcc only generates false positives from free(), not free() called by realloc().

Re: [Dnsmasq-discuss] cache.c:1683:30: warning: pointer used after ‘free’

2022-08-14 Thread Geert Stappers via Dnsmasq-discuss
On Fri, Aug 12, 2022 at 06:46:14PM +0100, Simon Kelley wrote: > ... Does your compiler still complain? > Nope ___ Dnsmasq-discuss mailing list Dnsmasq-discuss@lists.thekelleys.org.uk

Re: [Dnsmasq-discuss] cache.c:1683:30: warning: pointer used after ‘free’

2022-08-12 Thread Simon Kelley
Interesting. I think this is a false positive, as the "use" is pointer arithmetic to derive an integer offset, not a dereference. If you're going to complain about using "buff" like that, you should equally complain of using p, which just the value of buff that's just been freed incremented a

[Dnsmasq-discuss] cache.c:1683:30: warning: pointer used after ‘free’

2022-06-22 Thread Geert Stappers via Dnsmasq-discuss
Hello, With GCC version 12.1 I do get: cc -Wall -W -O2 -DVERSION='"2.87test8-16-g770bce9"' -c cache.c cache.c: In function ‘cache_make_stat’: cache.c:1683:30: warning: pointer used after ‘free’ [-Wuse-after-free] 1683 | p = new + (p - buff); |