https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109335
--- Comment #4 from Alejandro Colomar ---
Here's a smaller reproducer:
$ cat pass.c
#include
void my_free(char *p);
[[gnu::malloc(my_free)]] char *my_malloc(void);
int main(void)
{
char *p;
p = my_malloc();
my_free(
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109335
--- Comment #3 from Alejandro Colomar ---
Oops, no, that's a different story. The analyzer is thinking it leaks
somewhere where it doesn't seem to leak.
The false positive still reproduces with
gcc-14 (Debian 14-20240429-1) 14.0.1 20240429 (e
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109335
--- Comment #2 from Alejandro Colomar ---
This is probably because there's no way to mark a function as being a valid
deallocator (i.e., the converse of [[gnu::malloc()]]).
As a workaround, such deallocators could be defined (C99) inline, so th
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109335
Alejandro Colomar changed:
What|Removed |Added
CC||colomar.6.4.3 at gmail dot com
---