Inadequate errors persist after turning off all code inspection types
已回答
In CLion IDE I see error notifications such as "can't compare structures" for comparisons between iterators. Those notifications are wrong, code compiles without a problem. I tried to turn of code inspection, and turned off ALL types (not just clang-tidy). However, I still see those irritating error notifications. How can I get rid of them?
Another related question: what is the best way to specify c++ dialect (c++11, c++14, etc.) to make code inspection relevant?
请先登录再写评论。
Hi! Could you please provide the code snippet?
You can specify the C++ standard using set(CMAKE_CXX_STANDARD <value>) in your CMakeLists.txt.
Here is the code:
auto it = m_MapStkDateData.find(stk);
if (it == m_MapStkDateData.end())
return false;
In the IDE the comparison is highlighted in red with "can't compare structures" error note.
I tried to put set(CMAKE_CXX_STANDARD 14) in CMakeLists.txt, but that didn't change anything in regard to IDE behavior
Is m_MapStkDateData an std::unordered_map/std::unordered_set object or smth similar? We have the related issues in our tracker: https://youtrack.jetbrains.com/issue/CPP-10862 and https://youtrack.jetbrains.com/issue/CPP-11511. Please follow them to get updates.
You can suppress the inspection via "Alt-Enter" on the warning, then press "right" and select one of the suppression options from the submenu.
m_MapStkDateData is a map. The link you provided doesn't work ("the page was not found"). I have many warnings like that, do you suggest to suppress every one on them manually? I want to get rid of them completely, and I turned off all types of code inspection - still I see those warnings! Is there a different way to efficiently suppress code inspection and resulting warnings?
Sorry for the links, they were merged into one for some reason, I've fixed that.
Unfortunately, not all warnings can be disabled via File| Settings | Editor | Inspections. There is no additional way to disable the rest of inspections in CLion. Sorry for the inconvenience.