clang-tidy

What is proper LLVM header guard style?

家住魔仙堡 提交于 2019-12-01 04:17:40
问题 In clang tidy, the check [llvm-header-guard] looks for LLVM style header guards, but I can't find any examples of proper LLVM header guard style, specifically the structure of the name given to the define, the coding standards pages does not mention anything. 回答1: Looking at the unit tests: https://github.com/llvm-mirror/clang-tools-extra/blob/master/unittests/clang-tidy/LLVMModuleTest.cpp it seems to accept a few variations on the commonly used patterns. For a file named include/llvm/ADT/foo

“Use of a signed integer operand with a binary bitwise operator” - when using unsigned short

走远了吗. 提交于 2019-11-30 22:21:15
问题 In the following C snippet that checks if the first two bits of a 16-bit sequence are set: bool is_pointer(unsigned short int sequence) { return (sequence >> 14) == 3; } CLion's Clang-Tidy is giving me a "Use of a signed integer operand with a binary bitwise operator" warning, and I can't understand why. Is unsigned short not unsigned enough? 回答1: The code for this check seems to care if either operand to the bitwise operator is signed. It is not sequence causing the warning, but 14 , and you

clang-tidy: How to suppress warnings?

跟風遠走 提交于 2019-11-30 11:47:24
I recently started experimenting with the clang-tidy tool of llvm. Now I am trying to suppress false warnings from third party library code. For this I want to use the command line options -header-filter=<string> or -line-filter=<string> but so far without success. So for people with limited time I will put the question here at the beginning and explain later what I already tried. Question What option do I need to give to the clang-tidy tool to suppress a warning from a certain line and file? if this is not possible What option works to suppress warnings from external header files? What I did

clang-tidy: How to suppress warnings?

烈酒焚心 提交于 2019-11-29 17:40:55
问题 I recently started experimenting with the clang-tidy tool of llvm. Now I am trying to suppress false warnings from third party library code. For this I want to use the command line options -header-filter=<string> or -line-filter=<string> but so far without success. So for people with limited time I will put the question here at the beginning and explain later what I already tried. Question What option do I need to give to the clang-tidy tool to suppress a warning from a certain line and file?