[Bug analyzer/105022] -Wanalyzer-tainted-allocation-size doesn't warn for custom allocators marked with "malloc" attribute

dmalcolm at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Mar 25 13:36:42 GMT 2022


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105022

David Malcolm <dmalcolm at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |WONTFIX
             Status|UNCONFIRMED                 |RESOLVED

--- Comment #2 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
There isn't currently a way to express size argument(s) to the "malloc"
attribute.  Perhaps we could have a heuristic where if we see a single size_t
argument passed to such a function we assume it's the size - but none of the
examples in the docs work that way.  There are also cases analogous to calloc
which take a pair of numeric values.

Resolving this one as WONTFIX (in the absence of a way to express size params
for an allocation).


More information about the Gcc-bugs mailing list