shared: Ignore clang-analyzer on cleanup attribute
When using the cleanup attribute we know we are not leaking that
allocation. Most of the time the assignment is together with the
declaration, so we can simplify additional clang annotations by making
the cleanup attribute imply clang::suppress.
In cases declaration and assignment are not together, provide
_clang_suppress_alloc_ to annotate the code. That is only defined for
clang analyzer.
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/233