Yes, now I see it, thanks. Maybe this one shouldn't be inconclusive?
Yes, now I see it, thanks.
Well, I swear I've seen the warning before. I am using 2.14 in Ubuntu 22.04 and have pulled and built it myself and I'm already using --enable=all. I went ahead and made a new file called test.cpp and put that code in it and did cppcheck --enable=style test.cpp and I don't get a warning.
cppcheck-2.14.1/cli/filelister.cpp:186:53: warning: ignoring attributes on template argument ‘int ()(DIR)’ [-Wignored-attributes] std::unique_ptr<dir, decltype(&closedir)=""> dir_deleter(dir, closedir); // line #186</dir,> Ubuntu 22.04 Here's one way to ignore it #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wignored-attributes" std::unique_ptr<DIR, decltype(&closedir)> dir_deleter(dir, closedir); #pragma GCC diagnostic pop
I've seen this mistake made at multiple companies and it seems like an easy check to add if it doesn't already exist (passed without issue for me). bool bitwiseIncorrectUsageExample() { bool b1 = std::rand() % 2 == 1; bool b2 = std::rand() % 3 == 1; return b1 & b2; }
Perhaps clazy should catch this instead but sharing for awareness. If you check an item in a QMap, if it doesn't exist using [], it goes ahead and creates it. So if you have a map member variable and call a const != operator and inspect that map data by not using .value() it will go ahead and create it.
Perhaps clazy should catch this instead but sharing for awareness. If you check an item in a QMap, if it doesn't exist, it goes ahead and creates it. So if you have a map member variable and call a const != operator and inspect that map data by not using .value() it will go ahead and create it.
Thanks, we currently aren't using that tool but I'll look into it.