]> git.ipfire.org Git - thirdparty/kmod.git/commit
shared: Ignore clang-analyzer on cleanup attribute
authorLucas De Marchi <lucas.de.marchi@gmail.com>
Sat, 9 Nov 2024 22:53:22 +0000 (16:53 -0600)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Tue, 12 Nov 2024 00:11:11 +0000 (18:11 -0600)
commit317f89a59a428af714558f840cf7750a3900c8cd
tree474987b1f77f166b5342cd33ffe75c257e8328c1
parent4063401a051cebda5507618e7193b11b59957e75
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
shared/macro.h