good compile options for g++ options to enforce good coding

C

Cliff Martin

I would like to write code in the most platform independent and
correct way possible, and would like to use compiler options to help
enforce this. In C I would use

gcc -Wall -ansi -pedantic -O1

Is it the same for C++? Any options I should include?
 
L

Larry Smith

Cliff said:
I would like to write code in the most platform independent and
correct way possible, and would like to use compiler options to help
enforce this. In C I would use

gcc -Wall -ansi -pedantic -O1

Is it the same for C++? Any options I should include?

Try the g++ newsgroup

gnu.g++.help

The same options apply to the GCC C++ compiler, g++.

g++ -Wall -ansi -pedantic -O1

However, there are many more for both gcc & g++...
 

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

Staff online

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,040
Latest member
papereejit

Latest Threads

Top