473,406 Members | 2,713 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Strict ANSI-C

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.
Jan 20 '06 #1
5 6465

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

Jan 20 '06 #2
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.
"mmxbass" <mm*****@discussions.microsoft.com> wrote in message
news:E7**********************************@microsof t.com...
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.

Jan 20 '06 #3
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/
Jan 20 '06 #4
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?

"Bruno van Dooren" wrote:
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.
"mmxbass" <mm*****@discussions.microsoft.com> wrote in message
news:E7**********************************@microsof t.com...
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.


Jan 20 '06 #5
Disregard that. The entry just doesn't show up until after I import my source
files.

"mmxbass" wrote:
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?

"Bruno van Dooren" wrote:
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.
"mmxbass" <mm*****@discussions.microsoft.com> wrote in message
news:E7**********************************@microsof t.com...
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.


Jan 20 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Eric Myers | last post by:
Hello folks: (This message is also posted on the help forum at the pexpect sourceforge page, but all indentation in the code got stripped away when I submitted the post.) For some time I've...
100
by: Roose | last post by:
Just to make a tangential point here, in case anyone new to C doesn't understand what all these flame wars are about. Shorthand title: "My boss would fire me if I wrote 100% ANSI C code" We...
2
by: Bart Oldeman | last post by:
Hi, Open Watcom C defines NO_EXT_KEYS if you use it with -za ("disable extensions (i.e., accept only ISO/ANSI C)"), but isn't this a contradiction in itself; it's not in the implementation...
4
by: Luke Wu | last post by:
I am just wondering what the following terms usually mean: 1) "Standard C" 2) "K&R C" 3) "ANSI C" I am pretty sure "ANSI C" usually refers to the C89 standard, but what
17
by: David | last post by:
Hi all, I have the following problem: my program works fine, but when I add option strict at the top of the form, the following sub fails with an error that option strict does not allow late...
127
by: bz800k | last post by:
Hi Does this code satisfy ANSI C syntax ? void function(void) { int a = 2; a = ({int c; c = a + 2;}); /* <<-- here !! */ printf("a=%d\n", a);
0
NeoPa
by: NeoPa | last post by:
ANSI-89 v ANSI-92 Before we get into all the various types of pattern matching that can be used, there are two ANSI standards used for the main types of wildcard matching (matching zero or more...
41
by: jaysome | last post by:
It's been almost eight years since ISO/IEC approved ISO/IEC 9899:1999. Does anyone know if ANSI has approved it? A Google search shows arguably confusing answers as to whether ANSI has...
92
by: Erwin Moller | last post by:
Hi group, I encoutered page validation error, but I don't know a way around. The page has the following doctype: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.