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

Douglas Yung via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Feb 2 07:08:51 PST 2023


dyung added a comment.

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

> In D91000#4099669 <https://reviews.llvm.org/D91000#4099669>, @dyung wrote:
>
>>   -DLLVM_DEFAULT_TARGET_TRIPLE=x86_64-scei-ps4
>>
>> Hopefully this can help you to reproduce the problem.
>
> Ah, thank you very much. And indeed, giving `--target=x86_64-scei-ps4` to Clang-Tidy will make the test case fail, but using `x86_64-linux-gnu` works perfectly.
> Now knowing the exact triple I think I can delve into the preprocessor stack or something to figure out why the //Annex K.//-related flags, my best bet is that it's explicitly forbidden from being defined. 😉
>
>   clang-tidy /tmp/LLVM-Build/tools/clang/tools/extra/test/clang-tidy/checkers/bugprone/Output/unsafe-functions.c.tmp.c --checks='-*,bugprone-unsafe-functions' -config={} -- --target=x86_64-linux-gnu -D__STDC_LIB_EXT1__=1 -D__STDC_WANT_LIB_EXT1__=1 -nostdinc++
>
> My first wish is to figure out how to reliably disable the test case and have this quick-fix pushed immediately so the buildbots don't continue failing, and then we can figure out that this check should be disabled on this specific platform, or something like that...

One particular oddity of our platform is that we use a different default C++ and I think C standard, so if explicitly setting the C standard causes the test to pass, that is likely the case.

To XFAIL the test, grep for lines with "XFAIL" and "ps4" and you should find some examples. It was recently changed how it worked lately.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D91000



More information about the cfe-commits mailing list