[PATCH] D91000: [clang-tidy] Add bugprone-unsafe-functions checker.

Whisperity via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Oct 15 07:09:53 PDT 2022


whisperity added a comment.

In D91000#3770071 <https://reviews.llvm.org/D91000#3770071>, @whisperity wrote:

> In D91000#3197851 <https://reviews.llvm.org/D91000#3197851>, @aaron.ballman wrote:
>
>> In terms of whether we should expose the check in C++: I think we shouldn't. [...]
>>
>> I think we should probably also not enable the check when the user compiles in C99 or earlier mode, because there is no Annex K available to provide replacement functions.
>
> @aaron.ballman I think the current version of the check satisfies these conditions. It seems the check **will** run for every TU, but in case there is no alternative the check could suggest, it will do nothing:
>
>   if (!ReplacementFunctionName)
>     return;
>
> Is this good enough? This seems more future-proof than juggling the `LangOpts` instance in yet another member function.

@aaron.ballman @njames93 Ping!
It seems @futogergely has resigned from the company, so I'll end up flying the approach, but the one above is the last outstanding question.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91000/new/

https://reviews.llvm.org/D91000



More information about the cfe-commits mailing list