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

Offline fmc0501

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

Checked to make sure CppCheck loaded, then opened a console program and removed
Code: [Select]
using namespace std;and added
Code: [Select]
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?
Linux Mint 20
gcc version 9.3.0 / Target: x86_64-linux-gnu
Code::Blocks : svn-r0 / SDK Version : 2.4.0

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12779
    • 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: 17
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.
Linux Mint 20
gcc version 9.3.0 / Target: x86_64-linux-gnu
Code::Blocks : svn-r0 / SDK Version : 2.4.0