[Bug analyzer/94365] false positive leak when using container_of-like constructs

2024-04-08 Thread dmalcolm at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94365

--- Comment #3 from David Malcolm  ---
(In reply to David Malcolm from comment #2)
> Testing again with trunk (for GCC 12); the false leak of ‘a’ report still
> occurs, but the -Wanalyzer-free-of-non-heap report is fixed.

False leak still present with trunk (for GCC 14):
https://godbolt.org/z/nzjaMG7c8

[Bug analyzer/94365] false positive leak when using container_of-like constructs

2021-11-18 Thread dmalcolm at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94365

David Malcolm  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Last reconfirmed||2021-11-18
 Status|UNCONFIRMED |NEW

--- Comment #2 from David Malcolm  ---
Thanks for filing this.

The code changed a lot in GCC 11, and again in GCC 12.

Testing again with trunk (for GCC 12); the false leak of ‘a’ report still
occurs, but the -Wanalyzer-free-of-non-heap report is fixed.

[Bug analyzer/94365] false positive leak when using container_of-like constructs

2021-06-12 Thread dimitri at ouroboros dot rocks via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94365

dimitri at ouroboros dot rocks changed:

   What|Removed |Added

 CC||dimitri at ouroboros dot rocks

--- Comment #1 from dimitri at ouroboros dot rocks ---
Thanks for filing this one. 

We're using a double-linked-list implementation which also has this construct
using offsetof and are also seeing false positives in these parts of the code.
I thought the analyzer may have trouble with the list pointers, but I think it
will actually be the offsetof that is causing it.