User Activity

  • Modified a comment on discussion General Discussion on cppcheck

    Yes, now I see it, thanks. Maybe this one shouldn't be inconclusive?

  • Posted a comment on discussion General Discussion on cppcheck

    Yes, now I see it, thanks.

  • Posted a comment on discussion General Discussion on cppcheck

    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.

  • Posted a comment on discussion General Discussion on cppcheck

    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

  • Posted a comment on discussion General Discussion on cppcheck

    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; }

  • Modified a comment on discussion General Discussion on cppcheck

    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.

  • Posted a comment on discussion General Discussion on cppcheck

    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.

  • Posted a comment on discussion General Discussion on cppcheck

    Thanks, we currently aren't using that tool but I'll look into it.

View All

Personal Data

Username:
acarguy
Joined:
2012-07-19 03:38:09

Projects

  • No projects to display.

Personal Tools