473,327 Members | 2,071 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,327 software developers and data experts.

Makes it sense to get a copy of the ANSI standard documents?

As already noted a few months ago I'm working on a language, that
is intended to be compiled into C as an intermediary.

ATM I'm working with the latest publically avaliable draft of C99
avaliable from open-std.org. However I was considering to obtain
a copy of the real thing, but I wonder if it worth it. Mainly
I'm interested in _generating_ standard conforming code. Is it
worth it? Also I'd like to know, where to get a copy of the old
C90 standard, I can't find it on the ANSI website.

And then there's the question which version to target. C90 would
be the most portable for sure, OTOH any program compiled with my
compiler will have been written after 2006 so I can be sure to
have a final C stage that knows at least some C99. Some C99
features would be nice. So what is really safe to be used
_today_?

Wolfgang Draxinger
--
E-Mail address works, Jabber: he******@jabber.org, ICQ: 134682867

Apr 1 '08 #1
8 1370
On Apr 1, 5:14*pm, Wolfgang Draxinger <wdraxin...@darkstargames.de>
wrote:
As already noted a few months ago I'm working on a language, that
is intended to be compiled into C as an intermediary.

ATM I'm working with the latest publically avaliable draft of C99
avaliable from open-std.org. However I was considering to obtain
a copy of the real thing, but I wonder if it worth it. Mainly
I'm interested in _generating_ standard conforming code. Is it
worth it? Also I'd like to know, where to get a copy of the old
C90 standard, I can't find it on the ANSI website.

And then there's the question which version to target. C90 would
be the most portable for sure, OTOH any program compiled with my
compiler will have been written after 2006 so I can be sure to
have a final C stage that knows at least some C99. Some C99
features would be nice. So what is really safe to be used
_today_?

It certainly can't hurt to have a copy of the standard, at least it
gives you a baseline which is fairly well supported. See:

http://clc-wiki.net/wiki/The_C_Standard

For a list of ways to get the C89/90 standards. The commonly used
draft is pretty darn close to the final standard, and is free (unlike
the real dead tree version of c89).

While the real C99 standard is available for a reasonable price, and
even in electronic form, unfortunately c99 is very poorly supported in
the world.

While probably heresy in this group, targeting C++ instead of C as an
intermediate language has become very common, the ability to define
types and overloaded operators is very nice in this application. And C
++ is infinitely better supported than C99 (although not C89).
Apr 1 '08 #2
ro***********@yahoo.com wrote:
>
While probably heresy in this group, targeting C++ instead of C as an
intermediate language has become very common, the ability to define
types and overloaded operators is very nice in this application. And C
++ is infinitely better supported than C99 (although not C89).
This is pure nonsense.

Nobody is going to WRITE that code nor it is going to read it!
You can make your code call
add128(a,b)

with the SAME effort that you write
a+b

Operator overloading is useful for PEOPLE writing code.

When a machine writes the code nobody would care, and you
would have to cope with C++.

Did you know that code trhat compiled without a hitch in
IBM C++ xlc 8.0 will no longer compile in IBM xlc 9.0?

And code that compiled without any problems in gcc 3.4
will no longer compile in gcc 4.0?

C++ is a language that *maybe* is useful for people
writing code. For an automatic generator is sheer nonsense.

The more lower level you go, the better.
--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
Apr 1 '08 #3
Wolfgang Draxinger wrote:
As already noted a few months ago I'm working on a language, that
is intended to be compiled into C as an intermediary.

ATM I'm working with the latest publically avaliable draft of C99
avaliable from open-std.org. However I was considering to obtain
a copy of the real thing, but I wonder if it worth it. Mainly
I'm interested in _generating_ standard conforming code. Is it
worth it? Also I'd like to know, where to get a copy of the old
C90 standard, I can't find it on the ANSI website.

I think what you need is C95, not C90. C95 is C90 with some bugs fixed +
3 new headers, <wchar.h>, <iso646.h>, <wctype.h>.
If you can't find a copy of C95/C90, you can buy the book "The C
Programming Language" 2nd Edition by Brian Kernighan, Dennis Ritchie
(the creator of C) which towards the end has an "Appendix A: Reference
manual".

The first part of its introduction is the following:

"A1. Introduction

This manual describes the C language specified by the draft
submitted to ANSI on 31 October 1988, for approval as "American National
Standard for Information Systems-Programming Language C, X3.159-1989".
The manual is an interpretation of the proposed standard, not the
Standard itself, although care has been taken to make it a reliable
guide to the language".
Apr 1 '08 #4
Ioannis Vranos <iv*****@nospam.no.spamfreemail.grwrites:
Wolfgang Draxinger wrote:
>As already noted a few months ago I'm working on a language, that
is intended to be compiled into C as an intermediary.

ATM I'm working with the latest publically avaliable draft of C99
avaliable from open-std.org. However I was considering to obtain
a copy of the real thing, but I wonder if it worth it. Mainly
I'm interested in _generating_ standard conforming code. Is it
worth it? Also I'd like to know, where to get a copy of the old
C90 standard, I can't find it on the ANSI website.


I think what you need is C95, not C90. C95 is C90 with some bugs fixed +
3 new headers, <wchar.h>, <iso646.h>, <wctype.h>.
If you can't find a copy of C95/C90, you can buy the book "The C
Programming Language" 2nd Edition by Brian Kernighan, Dennis Ritchie
(the creator of C) which towards the end has an "Appendix A: Reference
manual".

The first part of its introduction is the following:

"A1. Introduction

This manual describes the C language specified by the draft
submitted to ANSI on 31 October 1988, for approval as "American National
Standard for Information Systems-Programming Language C, X3.159-1989".
The manual is an interpretation of the proposed standard, not the
Standard itself, although care has been taken to make it a reliable
guide to the language".
With all due respect, you do not even know about sequence points and
undefined behaviour. Do you really think you are qualified to tell a
compiler writer what versions of the standard he should be using?

K&R 2 is not a standard in the true "standard" sense.
Apr 1 '08 #5
Richard wrote:
>
With all due respect, you do not even know about sequence points and
undefined behaviour.

I know about undefined behaviour. I do not know about sequence points,
because all the books I have read regarding C and C++ didn't mention
them (I am in the application programming area, not compiler creation).
Of course, I'll check the standards to find out what sequence points are.

Do you really think you are qualified to tell a
compiler writer what versions of the standard he should be using?
I think I have a down to earth knowledge about the various C and C++
standards and their differences.

C95 is essentially the C standard that the most popular C compilers
support (and is the "C subset" of C++98/C++03).
Given that C95, is C90 fixed and improved, and not a major evolution
like C99, I think if one is to by a C standard that is not C99, he
should pick C95.
Apr 1 '08 #6
Wolfgang Draxinger wrote:
As already noted a few months ago I'm working on a language, that
is intended to be compiled into C as an intermediary.

ATM I'm working with the latest publically avaliable draft of C99
avaliable from open-std.org. However I was considering to obtain
a copy of the real thing, but I wonder if it worth it. Mainly
I'm interested in generating standard conforming code. Is it
worth it? Also I'd like to know, where to get a copy of the old
C90 standard, I can't find it on the ANSI website.
Here a draft of the C90 standard:
http://flash-gordon.me.uk/ansi.c.txt

You can purchase the current standard (INCITS/ISO/IEC 9899-1999
(R2005)) for $30, but the former standard is hard to come by for a
reasonable price.
And then there's the question which version to target. C90 would
be the most portable for sure, OTOH any program compiled with my
compiler will have been written after 2006 so I can be sure to
have a final C stage that knows at least some C99. Some C99
features would be nice. So what is really safe to be used
_today_?
If you use a fairly ubiquitous compiler like GCC, then you could safely
use the C99 features available in GCC.

HTH

--
Posted via a free Usenet account from http://www.teranews.com

Apr 2 '08 #7
On Apr 1, 5:43*pm, jacob navia <ja...@nospam.comwrote:
robertwess...@yahoo.com wrote:
While probably heresy in this group, targeting C++ instead of C as an
intermediate language has become very common, the ability to define
types and overloaded operators is very nice in this application. *And C
++ is infinitely better supported than C99 (although not C89).

This is pure nonsense.

Nobody is going to WRITE that code nor it is going to read it!
You can make your code call
* * * * add128(a,b)

with the SAME effort that you write
* * * * a+b

Operator overloading is useful for PEOPLE writing code.

When a machine writes the code nobody would care, and you
would have to cope with C++.

We'll have to disagree on this, but for just one example, your
approach requires the front end compiler to explicitly manage
temporaries when evaluating expressions, which is work that can be put
off to the C++ back end. The length of a particular function
invocation is not much of an issue for q code generator; but using
higher level constructs in the back end can often allow simpler code
to be emitted. Now you may *want* to do that in some cases to
maintain full control over how expression is evaluated, but C++ gives
you the choice.

Did you know that code trhat compiled without a hitch in
IBM C++ xlc 8.0 will no longer compile in IBM xlc 9.0?

And code that compiled without any problems in gcc 3.4
will no longer compile in gcc 4.0?

And there have never been release dependent glitches in C compilers?

That being said, using C as a back end will likely give you better
portability.

C++ is a language that *maybe* is useful for people
writing code. For an automatic generator is sheer nonsense.

The more lower level you go, the better.

Sometimes yes, sometimes no.
Apr 2 '08 #8
it makes sense to do anything opposite of what heathfield says.

don't read his book its total garbage.

he has no qualification in c

ask navia
Apr 2 '08 #9

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

Similar topics

3
by: Chris Mantoulidis | last post by:
I know this sounds really dumb a question, but where can I get an ISO/ANSI Standard C++ copy???
5
by: Stephen Tyndall | last post by:
Lots of people on this board refer people to sections of it and apparently know it very well; I was wondering where I can get a copy and how much it would cost (in American dollars, if possible). ...
4
by: William Payne | last post by:
Hello, I was under the impression that if I made a class Foo and if I didn't specify a copy constructor I would get one anyway that simply assigns the member variables (and that won't work for...
11
by: Kurt Krueckeberg | last post by:
Given a class X class X { public: X(int); X(const X&); //. . . }; Is this line X x1(1); the same thing as X x2 = 2;
10
by: Charles Harrison Caudill | last post by:
Forgive the ignorance, I don't have k&r w/ me at the moment: is there a way to do inline in ansi 89? 99? -- Harrison Caudill | .^ www.hypersphere.org Computer...
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
5
by: Boniek | last post by:
Hi I define a public property in a new form and I can see this property in table of Properties in Visual. How I can hide this property to see only in code ? Thank's Boniek
6
by: vpuvvada | last post by:
Please help me out in finding ANSI Standard specification documents for C and C++ Thanks Venkat
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.