473,516 Members | 2,737 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 6475

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
3085
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 wanted to make use of the ANSI.py module in the pexpect package to handle screen-based telnet sessions in Python, but I could never break the ice...
100
6825
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 are discussing whether this newsgroup should focus on 100% ANSI C or simply topics related to the C language in the real world. There is a C...
2
1693
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 defined namespace after all. This code for example int foo(void)
4
3731
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
4462
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 binding. What should I do? Public Sub MyMnuHandler(ByVal sender As Object, ByVal e As System.EventArgs) If sender.checked = True Then...
127
5380
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
10555
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 characters or simply matching a single character) : ANSI-89 - Mainly used only by Jet / ACE SQL ANSI-92 - Mainly used by SQL Server and other grown-up...
41
3108
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 approved it. For example, on this site: http://en.wikipedia.org/wiki/C_(programming_language)#ANSI_C_and_ISO_C it says that "It was adopted as an ANSI...
92
5060
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" "http://www.w3.org/TR/html4/strict.dtd"> Some hyperlinks need to open to a new window, so I used the (wrong) target="" attribute.
0
7182
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7581
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7548
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5714
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5110
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3267
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
1624
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
825
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
488
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.