3 C99 questions

C

carlos

Is there any book (not manual) in print that covers the C99 standard?

How far is gcc from compliance? The posted table seems to be dated.

If C++ and C99 are incompatible, how would that be solved?
An updated C++ standards document? A new pragma?

Thanks.
 
D

Daniel Fischer

Is there any book (not manual) in print that covers the C99 standard?

Err, well... the C99 standard itself. You can buy it as a download
e.g. from ANSI at $18. The printed version is a little more expensive.
How far is gcc from compliance? The posted table seems to be dated.

I have no idea. I only know the table at http://gcc.gnu.org/c99status.html
I wouldn't think of it as dated, it was last modified in july this year.
If C++ and C99 are incompatible, how would that be
solved?

It is best solved by not using C++.
An updated C++ standards document?

C++ is its own language and as far as I know, the Committee for Making C++
Worse Than Previously Thought Possible, which organizes all work on the
C++ standard, has no intention to keep C++ compatible with C at all cost.



Daniel
 
C

carlos

Any posted reports or papers on use in a real-world application?
Seems like C99 is moving slowly so far.
 
?

=?ISO-8859-1?Q?Bj=F8rn_Augestad?=

Any posted reports or papers on use in a real-world application?
Seems like C99 is moving slowly so far.

The Linux kernel uses (parts of) C99, AFAIK.
boa
 
P

pemo

Is there any book (not manual) in print that covers the C99 standard?

How far is gcc from compliance? The posted table seems to be dated.

If C++ and C99 are incompatible, how would that be solved?
An updated C++ standards document? A new pragma?

I think this is what you want for '1'

http://www.careferencemanual.com/

Not sure what you mean by '3' - "If C++ and C99 are incompatible, how would
that be solved?
An updated C++ standards document? A new pragma?"

Can you explain that a bit more please?
 
C

carlos

Not sure what you mean by '3' - "If C++ and C99 are incompatible, how would
that be solved?

Yes. Often large application programs consist of C++ "wrappers" that
provide an object library, and C "stubs" that do the grunt work, e.g.
computations, graphics or system level processing.
Often the C components are extracted from existing libraries.
If the C stubs are upgraded with C99 features incompatible with
C++, the marriage may break.

Getting rid of C++ will of course solve the compatibilty problem,
but in many cases it may be too expensive to recode wrappers in C99.
Think, for example, of the Cathia-Elfini CAD system used by Boeing
and Dassault to design new aircraft and "fly them on the computer".
The GUI wrapper represents the investment of thousands of PYs.

If C99 is to be widely accepted, that compatibility issue should be
addressed. Just saying that they are separate languages will
not solve it.
 
R

Robert Gamble

Yes. Often large application programs consist of C++ "wrappers" that
provide an object library, and C "stubs" that do the grunt work, e.g.
computations, graphics or system level processing.
Often the C components are extracted from existing libraries.
If the C stubs are upgraded with C99 features incompatible with
C++, the marriage may break.

Getting rid of C++ will of course solve the compatibilty problem,
but in many cases it may be too expensive to recode wrappers in C99.
Think, for example, of the Cathia-Elfini CAD system used by Boeing
and Dassault to design new aircraft and "fly them on the computer".
The GUI wrapper represents the investment of thousands of PYs.

If C99 is to be widely accepted, that compatibility issue should be
addressed. Just saying that they are separate languages will
not solve it.

I stay pretty far away from C++ but I recognize the issues you describe
and can understand your concern. Bringing C++ "back into sync" with
C99 has been discussed for quite some time and it looks like the C++
committee might be addressing these issues. In the December 2005 issue
of the C/C++ Users Journal P.J. Plauger mentions that the next version
of C++ will include at least some features introduced in C99 including
long long integers and all of the C99 preprocessor features. I don't
know what else needs to be done to meet the needs of those in your
position or what else is being addressed to do so but if you ask over
in comp.std.c++ you will probably get a better picture of what is being
done.

Robert Gamble
 
P

P.J. Plauger

I stay pretty far away from C++ but I recognize the issues you describe
and can understand your concern. Bringing C++ "back into sync" with
C99 has been discussed for quite some time and it looks like the C++
committee might be addressing these issues. In the December 2005 issue
of the C/C++ Users Journal P.J. Plauger mentions that the next version
of C++ will include at least some features introduced in C99 including
long long integers and all of the C99 preprocessor features. I don't
know what else needs to be done to meet the needs of those in your
position or what else is being addressed to do so but if you ask over
in comp.std.c++ you will probably get a better picture of what is being
done.

Right. The C++ committee has been a bit more accommodating of C
in recent years (and the C committee has been repaying the
compliment). On the library side, C++ has approved TR19768
(a.k.a. Library TR1) which include *all* of the C99 additions
to the Standard C library, plus glue code to reconcile
differences between the two forms of complex, etc. Dinkumware
has been shipping such a merged library for three years now.
While TR1 is not normative, it's likely to be widely adopted,
and it'll certainly serve as a proving ground for library
additions to C++0X, the next major revision of C++ currently
being developed.

On the language side, C++0X already has the language features
you cite from C99. The remaining features were triaged at
the Mt. Tremblant meeting in September. Things like variable
length arrays are not likely to be picked up, but other
features will get serious consideration.

HTH,

P.J. Plauger
Dinkumware, Ltd.
http://www.dinkumware.com
 
J

Jordan Abel

The Linux kernel uses (parts of) C99, AFAIK.
boa

The linux kernel uses GNU C, which contains some extensions that are
also c99 features, and some that are not. The only compilers that
support GNU C are gcc, and, i believe also icc.
 
J

Joe Wright

Jordan said:
The linux kernel uses GNU C, which contains some extensions that are
also c99 features, and some that are not. The only compilers that
support GNU C are gcc, and, i believe also icc.

Can you elaborate on icc?
 
T

Tim Prince

Jordan said:
The only compilers that
support GNU C are gcc, and, i believe also icc.

Surely that's not true in either way. More correct answers to this
would be found by browsing the archives. These 2 compilers may be the
most widely used compilers which implement many useful parts of C99. As
icc follows closely after gcc, there should be little difference in how
close they are to C99. Problem reports are in order when icc fails to
implement C99 where gcc does.
Both cover C++ with a different command from C, and both have extensions
(but not exactly the same ones) to implement some C99 features in C++.
 
?

=?ISO-8859-1?Q?Bj=F8rn_Augestad?=

Jordan said:
The linux kernel uses GNU C, which contains some extensions that are
also c99 features, and some that are not. The only compilers that
support GNU C are gcc, and, i believe also icc.


A standard C99 feature cannot be a GNU C extension, can it?
To quote Robert Love from the book Linux Kernel Development, 2nd
edition, page 17:
"The kernel developers use both ISO C99 and GNU C extensions to
the C language".


Boa
 
K

Keith Thompson

Tim Prince said:
Surely that's not true in either way. More correct answers to this
would be found by browsing the archives. These 2 compilers may be the
most widely used compilers which implement many useful parts of C99.
As icc follows closely after gcc, there should be little difference in
how close they are to C99. Problem reports are in order when icc
fails to implement C99 where gcc does.
Both cover C++ with a different command from C, and both have
extensions (but not exactly the same ones) to implement some C99
features in C++.

Um, the statement was about their support for GNU C, not for C99.
 
C

Chris Hills

I stay pretty far away from C++ but I recognize the issues you describe
and can understand your concern. Bringing C++ "back into sync" with
C99 has been discussed for quite some time and it looks like the C++
committee might be addressing these issues. In the December 2005 issue
of the C/C++ Users Journal P.J. Plauger mentions that the next version
of C++ will include at least some features introduced in C99 including
long long integers and all of the C99 preprocessor features. I don't
know what else needs to be done to meet the needs of those in your
position or what else is being addressed to do so but if you ask over
in comp.std.c++ you will probably get a better picture of what is being
done.

Robert Gamble

It's all very well bringing C++ back into line with C99 but no one is
using C99. As has been noted here there are many compilers supporting
parts of C99 but none fully.

In the embedded world the majority are stuck around C95
Gnu does it's own thing with GNU C extensions....

SO it appears that the worlds C compilers are C95+ extensions, some for
hardware and some are Gnu and some are C99.

Perhaps we need to go back to C90 and start again as C++ has C90 as a
root.
 
P

P.J. Plauger

The linux kernel uses GNU C, which contains some extensions that are
also c99 features, and some that are not. The only compilers that
support GNU C are gcc, and, i believe also icc.

The EDG front end is bug-for-bug compatible with GNU C, to the
extent that you can compile the Linux kernel with it. ICC
uses this front end, as do quite a number of other complers.
Some vendors I've talked to day that EDG does a better job of
being GNU C than GCC does.

P.J. Plauger
Dinkumware, Ltd.
http://www.dinkumware.com
 
J

Jordan Abel

A standard C99 feature cannot be a GNU C extension, can it?

My position would be that it can if it's in the "GNU89" feature set.
Which many of the features in question are.
 
R

Robert Harris

Is there any book (not manual) in print that covers the C99 standard?

Title: The C Standard
Publisher: John Wiley and Sons Ltd
ISBN: 0 470 84573 2
Price (on book): £34.95/$65.00
 

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

Similar Threads


Members online

Forum statistics

Threads
474,145
Messages
2,570,825
Members
47,371
Latest member
Brkaa

Latest Threads

Top