Checking Ansi-c++ conformity

O

Ollej Reemt

Hello,

I'm looking for a way to check/prove the ansi-c++ conformity of my
c++-code.
Does anyone know a tool for this problem? Or are there any
compiler-flags (for gcc, Visual C++ or any other compiler) to achieve this?
(Any not ansi-compliant statement should result in a warning or so)

Regards
ollej
 
R

Rolf Magnus

Ollej said:
Hello,

I'm looking for a way to check/prove the ansi-c++ conformity of my
c++-code.
Does anyone know a tool for this problem? Or are there any
compiler-flags (for gcc, Visual C++ or any other compiler) to achieve
this? (Any not ansi-compliant statement should result in a warning or so)

Minimal g++ warning flags you should use for this are:
-ansi -pedantic -W -Wall
 
J

Jonathan Arnold

Ollej said:
Hello,

I'm looking for a way to check/prove the ansi-c++ conformity of my
c++-code.
Does anyone know a tool for this problem? Or are there any
compiler-flags (for gcc, Visual C++ or any other compiler) to achieve this?
(Any not ansi-compliant statement should result in a warning or so)

And for Visual C++ (at least 6.0), the /Za flag "disables extensions".

Or use a lint program, like the one from Gimpel : http://www.gimpel.com
 
J

Josh

Ioannis Vranos said:
But the GCC manual says that it inhibits all warnings.

Check -Wextra. It says, among other things,

"(This option used to be called -W. The older name is still
supported, but the newer name is more descriptive.)"

I think you're confusing "-w" with "-W". They are different
options.

Josh
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top