Issue
With the most recent 3.3 update, Android Studio
seems to have a very annoying bug giving false warnings in C/C++ codes.
As you can see in the image above, the IDE signals warnings on every bit operation incorporating an immediate value even if it's a positive number.
The only way getting rid of this annoyance is to "typecast" the immediate values to uint32_t
which would be even more annoying.
Is there any option to suppress this kind of warnings in Android Studio
? I do tons of bit operations in my codes, and it annoys the hell out of me right now.
Or it could be clang's fault, assuming any immediate value to be a signed one by default. Are there compiler options to change it?
Solution
From Android Studio release notes:
Clang-Tidy Support for C++ - Android Studio now has support for Clang-Tidy for C++ static code analysis. Similar to the current lint support for Java and Kotlin in Android Studio, Clang-Tidy helps those who have C++ in their Android app identify common coding errors and bugs. Enable the inspection by going to Settings → Editor → Inspections (Preference → Editor → Inspections for MacOS) . Learn more.
So you can disable it from:
Preferences->Editor->Inspections->General->Clang-tidy
Bonus: You can find the list of Clang-Tidy options if you want to chose from: http://clang.llvm.org/extra/clang-tidy/#using-clang-tidy
Answered By - Mosbah
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.