[Bug analyzer/109335] -Wanalyzer-malloc-leak false positives and false negatives

2024-05-15 Thread alx at kernel dot org via Gcc-bugs
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();

[Bug analyzer/109335] -Wanalyzer-malloc-leak false positives and false negatives

2024-05-15 Thread alx at kernel dot org via Gcc-bugs
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

[Bug analyzer/109335] -Wanalyzer-malloc-leak false positives and false negatives

2024-05-15 Thread alx at kernel dot org via Gcc-bugs
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

[Bug analyzer/109335] -Wanalyzer-malloc-leak false positives and false negatives

2023-05-05 Thread colomar.6.4.3 at gmail dot com via Gcc-bugs
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 ---