Which C Standard is currently definitive for C++?

S

Steven T. Hatton

I wanted to take a look at the actual C Programming Language specification
which provides the libraries used by C++ in the <c*> Headers. A couple
days ago, I found it freely available on the internet. I originally
assumed it was an older, or draft version. I'm pretty sure what I have is
the same ISO/IEC 9899:1999, Programming languages ? C referenced in the C++
Standard. I'm now discovering that it is available in many places on the
internet for free. Has it been superceded? Is the distribution of the
entire C Programming Language Standard being legally distrubuted without
cost? I was going to buy the latest version, but I'm not sure what that
is, nor am I sure which one officially applies to C++. To read the C++
Standard, and take it at face value (often a dangerous proposition) I would
say what I have is the normative version.

Can anybody tell me what C Standard document is the correct one to use as a
reference to the latest C++ Standard?
 
V

Victor Bazarov

Steven said:
I wanted to take a look at the actual C Programming Language specification
which provides the libraries used by C++ in the <c*> Headers. A couple
days ago, I found it freely available on the internet.

A violation of the copyright, no doubt.
> I originally
assumed it was an older, or draft version. I'm pretty sure what I have is
the same ISO/IEC 9899:1999, Programming languages ? C referenced in the C++
Standard.

Actually the C++ standard refers to ISO/IEC 9899:1990 and ISO/IEC
9899:Amd.1:1995, and not 1999.
I'm now discovering that it is available in many places on the
internet for free.

"It" -- what?
> Has it been superceded?

"It" -- what?
> Is the distribution of the
entire C Programming Language Standard being legally distrubuted without
cost?

Not AFAIK.
> I was going to buy the latest version, but I'm not sure what that
is, nor am I sure which one officially applies to C++.

Get a version of the C++ Standard and you'll know. They are listed in
section 1.2 Normative references.
> To read the C++
Standard, and take it at face value (often a dangerous proposition) I would
say what I have is the normative version.

I don't understand this statement.
Can anybody tell me what C Standard document is the correct one to use as a
reference to the latest C++ Standard?

The C++ Standard should tell you that.

V
 
S

Steven T. Hatton

Victor said:
A violation of the copyright, no doubt.

Well, I'm not going to snitch on anybody, but some of the places I saw it
would probably be careful about such things.
Actually the C++ standard refers to ISO/IEC 9899:1990 and ISO/IEC
9899:Amd.1:1995, and not 1999.

The text appearing in my statement was copied directly from the C++
Standard. The Standard C Library, however is defined for C++ as the one
specified in the documents you listed.
"It" -- what?

ISO/IEC 9899:1999, Programming languages - C
"It" -- what?

ISO/IEC 9899:1999, Programming languages - C
Not AFAIK.


Get a version of the C++ Standard and you'll know. They are listed in
section 1.2 Normative references.

ISO/IEC 9899:1999, Programming languages - C, and I will assume that is not
impacted by the Cor. 1:2001(E) and Cor. 2:2004(E). And for the library I
believe that would not include TCOR1 nor TCOR2.

http://www.open-std.org/jtc1/sc22/wg14/www/standards
I don't understand this statement.

I have ISO/IEC 9899:1999, Programming languages - C, but I now realize that
this is not the normative version for the Standard C Library.
The C++ Standard should tell you that.

Seems I need two of them. And what is worse, the C++ Standard claims that

"The following referenced documents are indispensable for the application of
this document. For dated references, only the edition cited applies. For
undated references, the latest edition of the referenced document
(including any amendments) applies.

ISO/IEC 2382 (all parts), Information technology ? Vocabulary
...."

There are about 36 of these "parts" each costing a minimum of $18US. I
suspect there is actually very little in ISO/IEC 14882:2003(E) that relies
on ISO/IEC 2382.
 
P

Pete Becker

Steven said:
Victor Bazarov wrote:




The text appearing in my statement was copied directly from the C++
Standard. The Standard C Library, however is defined for C++ as the one
specified in the documents you listed.

Please cite the exact paragraph, so I can fix it. I haven't found any
reference to 9899:1999. Just, as Victor mentioned, 1990 and 1995.
 
S

Steven T. Hatton

Pete said:
Please cite the exact paragraph, so I can fix it. I haven't found any
reference to 9899:1999. Just, as Victor mentioned, 1990 and 1995.

§1.2/1

I see the references to 9899 before, and after the one I'm referring to are
to 1990 as opposed to 1999.
 
I

Ian

Steven said:
Can anybody tell me what C Standard document is the correct one to use as a
reference to the latest C++ Standard?

It my not be the ISO document, but I have found "The Standard C Library"
by P J Plauger to be invaluable for this.

Don't forget the C++ standard predates C99.

Ian
 
A

Axter

Steven said:
§1.2/1

I see the references to 9899 before, and after the one I'm referring to are
to 1990 as opposed to 1999.
--
If our hypothesis is about anything and not about some one or more
particular things, then our deductions constitute mathematics. Thus
mathematics may be defined as the subject in which we never know what we
are talking about, nor whether what we are saying is true.-Bertrand Russell

If you have the official ISO/IEC 14882:1998(E)C++ standard, you'll find
that it refers to ISO/IEC 9899:1990 in all places, including the
paragraph you're referring to.
However, if you're reading the official ISO/IEC 14882:2003(E)C++
standard, it does state the following in section 1.2:
***************************************************************************
[intro.refs] 1.2 Normative references
The following referenced documents are indispensable for the
application of this document. For dated
references, only the edition cited applies. For undated references, the
latest edition of the referenced
document (including any amendments) applies.

ISO/IEC 2382 (all parts), Information technology - Vocabulary
ISO/IEC 9899:1999, Programming languages - C
***************************************************************************

The 2003 version of the C++ standard only refers to 9899:1999 in the
above paragraph, and in all other sections of the standard, it refers
to the 9899:1990.
I believe this to be a type error in the 2003 version of the standard,
since the rest of the document only refers to 9899:1990.
You should use the 9899:1990 version of the C standard to validate
compliance with the C++ standard.
There are many things in the 9899:1999 version of the C standard that
are not part of the current C++ standard.
 
S

Steven T. Hatton

Ian said:
It my not be the ISO document, but I have found "The Standard C Library"
by P J Plauger to be invaluable for this.

As it turns out, it would seem that I inadvertently discovered a problem
with the C++ Standard while fumbling around for the answer to this
question. Someone has to actually look at the Standard documents from time
to time. It keeps 'm honest.

As for Plauger's book, it may be worth having on hand. When it comes to C
issues, though it may be slightly out of data, I use a book called _The C
Programming Language: /Second Edition/_ By Brian W. Kernighan and Dennis M.
Ritchie. It's usually sufficient to answer any questions I encounter. I
will observe that it's often useful to have two different reliable
references to the same subject.

I *do* believe that a C++ programmer should have the C++ Standard, ISO/IEC
14882:2003, on hand, and that he or she should read it.
Don't forget the C++ standard predates C99.

The current C++ Standard is ISO/IEC 14882:2003, but I believe it is correct
to say that it was (intended to be) based on C90.
 
B

Bart

Steven said:
The current C++ Standard is ISO/IEC 14882:2003, but I believe it is correct
to say that it was (intended to be) based on C90.

AFAIK, ISO/IEC 14882:1998 is the official standard for C++. ISO/IEC
14882:2003 is just a draft.


Bart.
 
S

Steven T. Hatton

Bart said:
AFAIK, ISO/IEC 14882:1998 is the official standard for C++. ISO/IEC
14882:2003 is just a draft.


Bart.

Well, I don't think I could FAQ you on that, but I'm pretty sure 2003 is the
current official Standard.

"Adopted by INCITS (InterNational Committee for Information Technology
Standards) as an American National Standard.

Date of ANSI Approval: 12/29/2003"
 
P

Pete Becker

Steven said:
Pete Becker wrote:




§1.2/1

I see the references to 9899 before, and after the one I'm referring to are
to 1990 as opposed to 1999.

I don't see any mention of 9899:1999 there. My copy lists these:

— ISO/IEC 2382 (all parts), Information technology – Vocabulary
— ISO/IEC 9899:1990, Programming languages – C
— ISO/IEC 9899/Amd.1:1995, Programming languages – C, AMENDMENT 1: C
Integrity
— ISO/IEC 10646-1:1993 Information technology – Universal Multiple-Octet
Coded Character Set
(UCS) – Part 1: Architecture and Basic Multilingual Plane
 
P

Pete Becker

Pete said:
I don't see any mention of 9899:1999 there. My copy lists these:

— ISO/IEC 2382 (all parts), Information technology – Vocabulary
— ISO/IEC 9899:1990, Programming languages – C
— ISO/IEC 9899/Amd.1:1995, Programming languages – C, AMENDMENT 1: C
Integrity
— ISO/IEC 10646-1:1993 Information technology – Universal Multiple-Octet
Coded Character Set
(UCS) – Part 1: Architecture and Basic Multilingual Plane

Whoops, I see it now. Apparently the INCITS version is different from
the ISO version.
 
P

Pete Becker

Axter said:
However, if you're reading the official ISO/IEC 14882:2003(E)C++
standard, it does state the following in section 1.2:
***************************************************************************
[intro.refs] 1.2 Normative references
The following referenced documents are indispensable for the
application of this document. For dated
references, only the edition cited applies. For undated references, the
latest edition of the referenced
document (including any amendments) applies.

ISO/IEC 2382 (all parts), Information technology - Vocabulary
ISO/IEC 9899:1999, Programming languages - C
***************************************************************************

Wierd: the ISO version doesn't have that, but the INCITS(ANSI) version does.
 
S

Steven T. Hatton

Pete said:
Axter said:
However, if you're reading the official ISO/IEC 14882:2003(E)C++
standard, it does state the following in section 1.2:
***************************************************************************
[intro.refs] 1.2 Normative references
The following referenced documents are indispensable for the
application of this document. For dated
references, only the edition cited applies. For undated references, the
latest edition of the referenced
document (including any amendments) applies.

ISO/IEC 2382 (all parts), Information technology - Vocabulary
ISO/IEC 9899:1999, Programming languages - C
***************************************************************************

Wierd: the ISO version doesn't have that, but the INCITS(ANSI) version
does.
"The nice thing about standards is that there are so many of them to choose
from." Andres S. Tannenbaum
 
I

Ian

Steven said:
Ian wrote:




As it turns out, it would seem that I inadvertently discovered a problem
with the C++ Standard while fumbling around for the answer to this
question. Someone has to actually look at the Standard documents from time
to time. It keeps 'm honest.

As for Plauger's book, it may be worth having on hand. When it comes to C
issues, though it may be slightly out of data, I use a book called _The C
Programming Language: /Second Edition/_ By Brian W. Kernighan and Dennis M.
Ritchie. It's usually sufficient to answer any questions I encounter. I
will observe that it's often useful to have two different reliable
references to the same subject.
It isn't out of date wrt C++ and the C standard library. It was
published in '92, after the C standard. K&R was published in '88.

The best format for both standards is the hardcopy books available on
Amazon.

Ian
 
S

Steven T. Hatton

Ian said:
Steven T. Hatton wrote:
It isn't out of date wrt C++ and the C standard library. It was
published in '92, after the C standard. K&R was published in '88.

Sorry for my obscure writing style. I was referring to K&R being slightly
out of date.
The best format for both standards is the hardcopy books available on
Amazon.

Ian

When I read the reviews on Amazon, I decided to hold off ordering the
hardcopy of the C++ Standard. The reports indicate that it is very poorly
bound. The last thing I want is a book that falls apart in my hands simply
because I actually read it.
 

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

Members online

No members online now.

Forum statistics

Threads
474,434
Messages
2,571,685
Members
48,796
Latest member
Greg L.

Latest Threads

Top