Strict ANSI-C

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.
 
A

adebaene

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
 
J

Jochen Kalmbach [MVP]

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/
 
B

Bruno van Dooren

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.
 
G

Guest

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?
 

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

Top