Author Topic: CppCheck not working?  (Read 3016 times)

Offline fmc0501

  • Multiple posting newcomer
  • *
  • Posts: 21
CppCheck not working?
« on: August 15, 2020, 02:04:19 am »
I installed cppcheck using
Code
sudo apt install cppcheck
and restarted C::B.

Checked to make sure CppCheck loaded, then opened a console program and removed
Code
 using namespace std;
and added
Code
 cout <<
inside main. I thought, through the use of CppCheck, that I'd get an error for leaving off std::, but I didn't. This behavior's included Visual Studio's editor and Qt's Creator through Intellisense and ?clangd? respectively. If not CppCheck, then is there a plugin that performs similarily to Intellisense?
Win X / wxWidgets-3.1.5
Code::Blocks 20.03

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: CppCheck not working?
« Reply #1 on: August 15, 2020, 07:45:05 am »
CppCheck is a static analyzer, a linter. It detects certain patterns which are questionable or buggy.

If you compile your project you'll probably get an error. Such errors are reported by the compiler.
I suppose visual studio and qtcreator provide fix-me-s, C::B currently doesn't.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline fmc0501

  • Multiple posting newcomer
  • *
  • Posts: 21
Re: CppCheck not working?
« Reply #2 on: August 16, 2020, 12:28:12 am »
It aint really necessary anyhow. Just kind of neat to have errors caught on the fly. That's all.

Thanks for your answer, oBFusCATed.
Win X / wxWidgets-3.1.5
Code::Blocks 20.03