Why clang-tidy suggests to add [[nodiscard]] everywhere?

This option is apparently “modernize-use-nodiscard”, so you can deactivate that if you prefer. It should be noted that the rules this option outlines are not the rules the C++ standard committee themselves use for when to apply [[nodiscard]]. Those rules being: It should be added where: For existing API’s not using the return value always … Read more

How to build the latest clang-tidy?

Up-to-date steps: git clone https://github.com/llvm/llvm-project.git cd llvm-project mkdir build cd build cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLLVM_ENABLE_PROJECTS=”clang;clang-tools-extra” ../llvm make install clang-tidy Reference, ninja, and other details: my own blog post.

How to install clang-tidy on macOS?

I don’t think there is a really easy way to do this today, here are some details: clang comes installed on macOS and is the default compiler, but it does not come installed with clang-format or clang-tidy (or possibly any of the extra tools). It’s really easy to use brew to install clang-format if you … Read more

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

The code for this warning checks if either operand to the bitwise operator is signed. It is not sequence causing the warning, but 14, and you can alleviate the problem by making 14 unsigned by appending a u to the end. (sequence >> 14u) This warning is bad. As Roland’s answer describes, CLion is fixing … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)