Strict ANSI-C

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In Visual Studio 2005, how can I set my project to be a strict ANSI-C project
with absoloutly nothing else? I don't want my project to even compile if it
contains any C++ or non-ANSI code.
 
mmxbass a écrit :
In Visual Studio 2005, how can I set my project to be a strict ANSI-C project
with absoloutly nothing else? I don't want my project to even compile if it
contains any C++ or non-ANSI code.

Be aware that VC++ supports C89, not C99.

Project -> Settings -> C/C++, then :
Language --> Disable language extensions set to "yes (/Za)".
Advanced --> Compile As "C code (/TC)"

Arnaud
MVP - VC
 
Hi mmxbass!
In Visual Studio 2005, how can I set my project to be a strict ANSI-C project
with absoloutly nothing else? I don't want my project to even compile if it
contains any C++ or non-ANSI code.

Additional to Arnaud posts: Rename your file from .cpp to .c

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
 
you can use the /Za flag (in your project properties: configuration
properties ->C/C++ ->Language->disable language extensions) to disable the
microsoft extensions, so that only ANSI C and C++ compiles.

to allow only C syntax, you can use the /TC switch (in your project
properties: configuration properties ->C/C++ ->advanced->compile as)

kind regards,
Bruno.
 
In my project properties under "Configuration Properties" I have:
-General
-Debugging
-Linker
-Manifest Tool
-XML Document Generator
-Browse Information
-Build Events
-Custom Build Setup
-Web Deployment

I do not have a C/C++ entry here.
This -is- a C++ project (I double checked).
Were your directions for VS 2005?
 
Back
Top