0

I am using a static docker that checks the codes of a project. ( See https://github.com/Ericsson/codechecker/blob/master/docs/usage.md for more details).

I got a C++ Project that I needed to analyse. I built the Project on eclipse and the rebuilt it using the Codechecker docker on the terminal. And the I generated a "makefile" using the "make"/ "makeall" command.

After analysing the compilation.json of the project. I got the following errors:

cppcheck: error: unrecognized command line option: "--std=c++0x".

I tried changing the configuration on eclipse, by adding on the Building configuration the "--std=c++0x" and "--std=c++11" option. I also did the following:

cc1plus: error: unrecognized command line option "-std=c++0x"

How and where can I add a configuration that lets the cppcheck recognises the line 2--std=c++0x"?

Sunderam Dubey
  • 1
  • 11
  • 20
  • 40
Ramref
  • 1

1 Answers1

0

I am a cppcheck developer. Sorry for late reply. Not sure what problem you have both "--std=c++0x" and "--std=c++11" works fine as far as I see. can it be reproduced on some simple test file?

These commands work fine for me:

echo "a=1;" > file1.cpp
cppcheck --std=c++0x file1.cpp
cppcheck --std=c++11 file1.cpp
Daniel Marjamäki
  • 2,907
  • 15
  • 16
  • Sadly it is not working. He just does not recognize the line option "--std=c++0x": $ echo "a=1;" > file1.cpp $ cppcheck --std=c++0x file1.cpp cppcheck: error: unrecognized command line option: "--std=c++0x". While --std=c++11 seems to be working: $ cppcheck --std=c++11 file1.cpp Checking file1.cpp ... – Ramref Mar 14 '23 at 15:14
  • I am using Ubuntu 20.04, and I also checked the cppcheck manual and found out that the cppcheck does not have -std=c++0x as an option (see the page 14 on: http://cppcheck.net/manual.pdf – Ramref Mar 14 '23 at 15:19
  • It depends on what version you use. Cppcheck 1.90 does not have "--std=c++0x". Latest cppcheck 2.10 has "--std=c++0x" although it's not documented in the manual. We don't recommend "--std=c++0x" it's just there for convenience/compatibility reasons. I don't know if an cppcheck upgrade is possible or if it would be easier to replace c++0x with c++11.. – Daniel Marjamäki Mar 15 '23 at 17:46