By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,750 Members | 1,165 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,750 IT Pros & Developers. It's quick & easy.

Checking Ansi-c++ conformity

P: n/a
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
Jul 23 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Ollej Reemt wrote:
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

Jul 23 '05 #2

P: n/a
Ollej Reemt wrote:
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

--
Jonathan Arnold (mailto:jd******@buddydog.org)
The Incredible Brightness of Seeing, a Home Theater weblog
http://www.anaze.us/HomeTheater
Jul 23 '05 #3

P: n/a
Rolf Magnus wrote:
Minimal g++ warning flags you should use for this are:
-ansi -pedantic -W -Wall

Isn't -W the opposite of the rest?

--
Ioannis Vranos

http://www23.brinkster.com/noicys
Jul 23 '05 #4

P: n/a
Ioannis Vranos wrote:
Rolf Magnus wrote:
Minimal g++ warning flags you should use for this are:
-ansi -pedantic -W -Wall

Isn't -W the opposite of the rest?


No.

Jul 23 '05 #5

P: n/a
Rolf Magnus wrote:
Ioannis Vranos wrote:

Rolf Magnus wrote:

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

Isn't -W the opposite of the rest?

No.

But the GCC manual says that it inhibits all warnings.

--
Ioannis Vranos

http://www23.brinkster.com/noicys
Jul 23 '05 #6

P: n/a
Ioannis Vranos <iv*@remove.this.grad.com> writes:
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
Jul 23 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.