RFC: Macro for 'analyzer_noreturn' attribute

Jordan Rose jordan_rose at apple.com
Thu Mar 28 14:06:14 PDT 2013


On Mar 28, 2013, at 12:51 , Sean Silva <silvas at purdue.edu> wrote:

> Thanks, that explains it. Please put this information in our documentation somewhere whenever you get around to implementing this.

Sure. The canonical explanation is at http://clang-analyzer.llvm.org/annotations.html#custom_assertions, but I'll also describe the attribute macro in docs/ somewhere.


> It definitely reeks of being the a twice-fallback (after the two other solutions you proposed), but I can't think of a better way to do it. Off the top of your head, how many of these attributes do you think we will need to sprinkle around the codebase?

It's narrowly applicable, so I'm not expecting it to show up much else. It's essentially useful for functions that are used where we might have thrown an exception, if LLVM used exceptions. (We model 'throw' in the same way: stop analyzing this path.)

In skimming through the LLVM errors (including the cross-file ones, which John's reports don't include right now), I haven't seen many other classes of issues that could instantly be solved this way. Ideally the gtest-related false positives would have some similar annotation, but they implement "assertNot" in a slightly roundabout way that doesn't all live in standard headers.

Jordan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130328/76de6328/attachment.html>


More information about the llvm-commits mailing list