[clang] nonblocking/nonallocating attributes: 2nd pass caller/callee analysis (PR #99656)

Chris Apple via cfe-commits cfe-commits at lists.llvm.org
Fri Sep 6 10:10:06 PDT 2024


cjappl wrote:

Hi @dougsonos 

We’re experiencing an unforeseen pain point trying to use rtsan without function effects, and wanted to ask **how you would feel about making function effect warnings opt-in rather than opt-out.** 

While users can easily opt in to function effects and not rtsan, the problem is that they can’t easily opt in to rtsan and not function effects. 

Here’s why: someone wanting to try out rtsan can add the `[[nonblocking]]` attribute, but this automatically opts them in to function effect warnings. For users who compile with `-Werror`, this means they will likely be unable to compile the code they wish to test with rtsan unless they explicitly turn off function effects warnings with -Wno-function-effects. If they’re not familiar with function effects they won’t know this, and we’re worried about an education gap causing them to blame rtsan and give up on it before realizing they can flick the function effects warnings off.

By disabling these warnings by default, both tools have the same "activation" of attribute + compile time flag, and it is equally easy to run either tool in isolation, or together.

https://github.com/llvm/llvm-project/pull/99656


More information about the cfe-commits mailing list