I have a C++ codebase, and I am porting from Visual Studio to g++, which should I set in Visual Studio so that build errors in gcc are reduced? With g++ this is achieved by -ansi -pedantic.
views:
53answers:
3
+1
A:
The only real way to do this is to compile under VStudio AND under GCC. GCC can be a lot more pedantic than VStudio :)
Goz
2010-02-18 22:26:50
@Goz:"GCC can be a lot more pedantic than VStudio" -- and vice versa. They're pedantic about different things.
Jerry Coffin
2010-02-18 23:09:36
Had totally forgotten about that switch. TBH, though, GCC is still a HELL of a lot more pedantic :)
Goz
2010-02-18 22:36:36
+1
A:
You should probably set the highest warning level /W4 and also disable the MS specific language extensions, /Za. Also check that you're using the for loop scope option /Zc:forScope
the_mandrill
2010-02-18 22:35:30
/Zc:forScope is the default. There is no need to specify this switch explicitly.
Billy ONeal
2010-02-19 00:04:44
It's the default for new projects, but if you have a project that was started in VS2003 and then upgraded through 2005 and/or 2008 then it will be switched off, so it's worth checking.
the_mandrill
2010-02-23 09:23:43