[PATCH] D54222: [clang-tidy/checks] Add a checker to detect returning static locals in public headers
Joe Ranieri via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Nov 7 12:55:09 PST 2018
jranieri-grammatech created this revision.
jranieri-grammatech added reviewers: aaron.ballman, alexfh, NoQ.
Herald added subscribers: cfe-commits, mgorny.
This adds a checker, llvm-problematic-statics, that detects functions in header files that return the address of a local static variable. These cause problems if the resulting pointer is expected to be unique because it may have different values across shared library boundaries.
It's has been a problem in the static analyzer that I've had to deal with in the past (https://reviews.llvm.org/D52905 and https://reviews.llvm.org/D52906).
rCTE Clang Tools Extra
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 6349 bytes
Desc: not available
More information about the cfe-commits