Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.8k views
in Technique[技术] by (71.8m points)

visual studio 2010 - VS2010 C and C++ - enforce ANSI compliance for Linux/gcc compatibility?

I'm taking a class in which I'm required to write some C++ apps for Linux. I really, really dislike the dev tools available under Linux, but I love VS2010.

Is there any sort of compiler switch which will enforce ANSI or gcc compatibility in VC++? Or can I swap the compiler out for gcc and still use the VS environment?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You can disable Microsoft extensions to the ANSI C and ANSI C++ standards by specifying the /Za flag, which will make the compiler emit errors if you use non-standard C and C++ features.

http://msdn.microsoft.com/en-us/library/0k0w269d(v=VS.100).aspx

However, this doesn't preclude you from using platform specific headers.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share

2.1m questions

2.1m answers

63 comments

56.5k users

...