The C Programming Language: Third Edition

K

Keith Thompson

Mark McIntyre said:
This isn't entirely true though - it will be portable, but not
maximally portable. Plenty of implemnentations exist which implement
*some* c99 features.

What's the difference between "portable" and "maximally portable"?

If I write code that assumes long is exactly 32 bits, for expamle, it
will be "portable", but only to implementations on which that
assumption is true. That's not what I call "portable".
Hard though it is for me to disagree with Richard /this/ is actually
untrue. I've yet to meet a C compiler younger than my son that
didn't accept // comments.

Richard uses gcc with options that enforce C90 compliance. With those
options, it rejects // comments. Without those options, it fails to
catch certain errors that he's very interested in catching.

If there were an option to accept // comments without disabling any
other diagnostics, you'd have a better point.
 
R

Richard Heathfield

Mark McIntyre said:

I've yet to meet a C compiler younger than my son that
didn't accept // comments.

Well, I don't know how old your son is, but I do know that the C compiler
that I habitually use, the binary of which is dated 23 March 2002,
correctly rejects // "comments" when invoked in conforming mode.
 
M

Mark McIntyre

What's the difference between "portable" and "maximally portable"?

Rhetorical (or disingenuous) question, therefore not answered.
If I write code that assumes long is exactly 32 bits, for expamle, it
will be "portable", but only to implementations on which that
assumption is true. That's not what I call "portable".

I agree although one can prove virtually anything with pathological
examples. I could equally note that printf or rand aren't portable.
Richard uses gcc

I assume you're a mind-reader.
with options that enforce C90 compliance. With those
options, it rejects // comments.

Run that by me again: in C90 mode this compiler doesn't conform to
C99?
Without those options, it fails to
catch certain errors that he's very interested in catching.

Again, you're a mind reader.
If there were an option to accept // comments without disabling any
other diagnostics, you'd have a better point.

You'd have had one if there were actually any sense to these remarks.
Sorry, but you're being silly - you suggest the compiler be invoked in
C90 mode, and then say that it doesn't conform to C99. Come now.
--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
 
M

Mark McIntyre

Well, I don't know how old your son is,
Ten.

but I do know that the C compiler
that I habitually use, the binary of which is dated 23 March 2002,

About the age of my youngest son.
correctly rejects // "comments" when invoked in conforming mode.

Well *obviously* it rejects them in conforming #C90# mode. What would
you have it do? Lets not be silly.

--
Mark McIntyre

"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
 
I

Ian Collins

Mark said:
About the age of my youngest son.




Well *obviously* it rejects them in conforming #C90# mode. What would
you have it do? Lets not be silly.
<OT>
At risk of pouring oil on the flames, a lot of compatibility issues stem
form the default setting for gcc being 'compile it if it looks vaguely
like C', where other compiler's defaults are closer to ANSI.

Which gives us the silly situation where the only way to get gcc to warn
about stuff that would upset another compiler in default mode, one has
to turn the warning levels up to maxi. Which is something very few
people (this group excluded) bother to do.

Spoken as one who has had to port too much code from gcc.
</OT>
 
K

Kenny McCormack

Rhetorical (or disingenuous) question, therefore not answered.

(rest of more of the same - the great MarkMc disagreeing [in sarcastic,
bitter tones] with the great Keith Thompson - snipped. Oh my!)

Or, more poetically:

Uh, oh. Cat fight!!!
 
R

Richard Heathfield

Mark McIntyre said:
On Sun, 02 Jul 2006 20:12:24 GMT, in comp.lang.c , Keith Thompson


I assume you're a mind-reader.

No, he just has a good memory. I have made it clear in the past that, for
everyday use, I favour gcc. And naturally I invoke it in conforming mode
(bearing in mind that this is C90 conformance, since the version I use
doesn't have a C99 conforming mode - and indeed I am unaware of any
C99-conforming gcc implementation).

Run that by me again: in C90 mode this compiler doesn't conform to
C99?

Right. In C90, // this is a syntax error.

Again, you're a mind reader.

No, again he simply has a good memory.
You'd have had one if there were actually any sense to these remarks.
Sorry, but you're being silly - you suggest the compiler be invoked in
C90 mode,

No, he's not suggesting any such thing; he is merely reporting what actually
happens.
and then say that it doesn't conform to C99. Come now.

Mark, he's /right/. Please don't call him silly for being right. I invoke
the compiler in C90 conforming mode for portability reasons. Note that, on
the implementation I use, there *isn't* a C99-conforming mode.

And programs that take advantage of C99 features are very likely to break
when compiled by a C90 implementation.
 
R

Richard Heathfield

Mark McIntyre said:
About the age of my youngest son.


Well *obviously* it rejects them in conforming #C90# mode.

Right. But it's the only ISO-conforming mode that implementation has, and
I'm not about to drop conformance checking just so that I can have borken
one-line comments.
 
R

Richard Heathfield

Mark F. Haigh said:
Richard Heathfield wrote:
You've had six and a half years, people - and *still* almost nobody is
using a fully conforming C99 compiler or library. [...]

As I wrote in another article:

* GCC / Linux has much of C99 implemented, and is gradually improving.
* Sun Studio / Solaris 10 has C99 support.
* IBM VisualAge / AIX 5.3 has C99 support.
* HP compiler / HPUX 11 has C99 support.
* Portland Group / Win32/64 has C99 support.
* Comeau compiler / Dinkum C99 libs have C99 support.
* Intel C compiler has smatterings of C99.

This is not "almost nobody", by any stretch.

Um, yes it is, once we realise that:

(a) my "almost nobody" refers to customers, not vendors. Note that I said
"almost nobody is /using/ a fully conforming C99 compiler or library". I
have every respect for Greg Comeau, for example, but I am sure he'd be the
first to agree that his user base is the tiniest fraction of Microsoft's.

(b) "much of" and "smatterings" don't count. Full conformance is what
matters where portability is concerned.

(c) gcc is not gradually improving C99 performance. It made huge inroads,
hit some showstopper obstacles, and stopped the show. No progress for
years, as far as I can tell.
 
M

Mark F. Haigh

Richard said:
Mark F. Haigh said:
Richard Heathfield wrote:
You've had six and a half years, people - and *still* almost nobody is
using a fully conforming C99 compiler or library. [...]

As I wrote in another article:

* GCC / Linux has much of C99 implemented, and is gradually improving.
* Sun Studio / Solaris 10 has C99 support.
* IBM VisualAge / AIX 5.3 has C99 support.
* HP compiler / HPUX 11 has C99 support.
* Portland Group / Win32/64 has C99 support.
* Comeau compiler / Dinkum C99 libs have C99 support.
* Intel C compiler has smatterings of C99.

This is not "almost nobody", by any stretch.

Um, yes it is, once we realise that:
<snip>

You said "almost nobody is using a fully conforming C99 compiler or
library". In my opinion, __just__ the intersection of people using
Sun, IBM, and HP's latest, fully C99-conformant offerrings is far above
"almost nobody".

I suppose we can agree to disagree. You've turned into quite the
anti-C99 spokesman recently.


Mark F. Haigh
(e-mail address removed)
 
C

Chris Hills

Mark said:
Richard said:
Mark F. Haigh said:
Richard Heathfield wrote:
You've had six and a half years, people - and *still* almost nobody is
using a fully conforming C99 compiler or library. [...]

As I wrote in another article:

* GCC / Linux has much of C99 implemented, and is gradually improving.
* Sun Studio / Solaris 10 has C99 support.
* IBM VisualAge / AIX 5.3 has C99 support.
* HP compiler / HPUX 11 has C99 support.
* Portland Group / Win32/64 has C99 support.
* Comeau compiler / Dinkum C99 libs have C99 support.
* Intel C compiler has smatterings of C99.

This is not "almost nobody", by any stretch.

Um, yes it is, once we realise that:
<snip>

You said "almost nobody is using a fully conforming C99 compiler or
library". In my opinion, __just__ the intersection of people using
Sun, IBM, and HP's latest, fully C99-conformant offerrings is far above
"almost nobody".

I suppose we can agree to disagree. You've turned into quite the
anti-C99 spokesman recently.

GCC is NOT C99 compliant, neither is Intel C.... like many they are
"working towards"

The Unix compilers do have C99 support, largely I believe, for political
reasons not technical reasons. Having C99 support and using it are two
different things.

We are seven years down the line from C99 and a lot of the compiler
companies had sight of the new standard before publication. Certainly
the FCD that went out for review.

You actually missed out that a LOT of C compilers are potentially C99
compliant as they use the EDG front end and the Dimkumware libraries
which are both fully C99.

HOWEVER the compiler writers choose not to fully implement C99 in the
compiler. No demand to do so from the market.

There has been no rush to implement C99 you have listed 7 compilers that
are C99 compliant out of how many C compilers are there out there?

The number of people actually using C99 compared to those who use C95 is
small. The Unix C99 compilers have only been announced recently (within
the last year?) and no one jumps standards in the middle of a project.
In practical terms those actually using C99 on a fully C99 compiler is
probably "almost nobody".
 
M

Mark F. Haigh

Chris said:
Mark said:
Richard said:
Mark F. Haigh said:

Richard Heathfield wrote:
<snip>
You've had six and a half years, people - and *still* almost nobody is
using a fully conforming C99 compiler or library. [...]

As I wrote in another article:

* GCC / Linux has much of C99 implemented, and is gradually improving.
* Sun Studio / Solaris 10 has C99 support.
* IBM VisualAge / AIX 5.3 has C99 support.
* HP compiler / HPUX 11 has C99 support.
* Portland Group / Win32/64 has C99 support.
* Comeau compiler / Dinkum C99 libs have C99 support.
* Intel C compiler has smatterings of C99.

This is not "almost nobody", by any stretch.

Um, yes it is, once we realise that:
<snip>

You said "almost nobody is using a fully conforming C99 compiler or
library". In my opinion, __just__ the intersection of people using
Sun, IBM, and HP's latest, fully C99-conformant offerrings is far above
"almost nobody".

I suppose we can agree to disagree. You've turned into quite the
anti-C99 spokesman recently.

GCC is NOT C99 compliant, neither is Intel C.... like many they are
"working towards"

Correct, as I take care to note above. GCC does, however, have a
substantial amount of C99 implemented.
The Unix compilers do have C99 support, largely I believe, for political
reasons not technical reasons. Having C99 support and using it are two
different things.

The support is there because somebody wanted it and somebody spent the
time to implement it. Having the support and using it are two
different things, but you need to have it before you can use it, don't
you think?
We are seven years down the line from C99 and a lot of the compiler
companies had sight of the new standard before publication. Certainly
the FCD that went out for review.

You actually missed out that a LOT of C compilers are potentially C99
compliant as they use the EDG front end and the Dimkumware libraries
which are both fully C99.

I'm aware of that.
HOWEVER the compiler writers choose not to fully implement C99 in the
compiler. No demand to do so from the market.

There has been no rush to implement C99 you have listed 7 compilers that
are C99 compliant out of how many C compilers are there out there?

The number of people actually using C99 compared to those who use C95 is
small. The Unix C99 compilers have only been announced recently (within
the last year?) and no one jumps standards in the middle of a project.
In practical terms those actually using C99 on a fully C99 compiler is
probably "almost nobody".

But the proportion of those using some of C99 on a C99-ish compiler /
library is certainly not "almost nobody".

Also, a non-"almost nobody" segment of the developer population have
access to conforming C99 implementations, on a variety of common and
important platforms. Time will tell which C99 features are used the
most, but it's starting to show up in earnest right about now.

Mark F. Haigh
(e-mail address removed)
 
K

Keith Thompson

Mark McIntyre said:
Rhetorical (or disingenuous) question, therefore not answered.

It was neither rhetorical nor disingenuous.

There are degrees of portability. If I refer to something as
"portable", without qualification, I probably mean what you refer to
as "maximally portable". I don't know what distinction you're trying
to make.

Code written in conforming C90 and avoiding any conflicting C99
features (e.g., that avoids using "restrict" or "inline" as
identifiers) is what I'd call "maximally portable", or very close to
it.

[...]
I assume you're a mind-reader.

Richard addressed this elsethread.
Run that by me again: in C90 mode this compiler doesn't conform to
C99?

Um, yes. Do you have a problem with that statement?

[...]
You'd have had one if there were actually any sense to these remarks.
Sorry, but you're being silly - you suggest the compiler be invoked in
C90 mode, and then say that it doesn't conform to C99. Come now.

If Richard wants to write conforming C90 code, he can specify a
certain set of options to gcc; gcc will then issue diagnostics for any
code that doesn't conform to C90. (Or close enough; there's always
the possibility of bugs, but gcc seems to be reasonably solid in this
area.) The resulting code, if gcc accepts it, is very likely to be
portable to any other conforming C90 implementation.

If he wants to write conforming C99 code using the full language, he
can't do it, since gcc doesn't support the full C99 language. He can
write code in the subset of C99 that gcc supports, but such code won't
be portable, since other compilers may support different subsets of
C99; if his code depends on a certain C99 feature that gcc happens to
support, it might break on another compiler that doesn't happen to
support that particular feature (even if it supports a number of other
C99 features).

You say that virtually all C compilers support "//" comments. That
may be true, but gcc doesn't provide a set of options to accept code
written a dialect consisting of just C90 plus "//" comments. You can
tell gcc to accept "//" comments, but only by telling to accept either
the GNU C dialect or the C99 subset that gcc supports. Either option
disables some conformance checks that are necessary if you're going to
write maximally portable code.
 
R

Richard Heathfield

Mark F. Haigh said:

You've turned into quite the anti-C99 spokesman recently.

Yes, I suppose I have - and yet I am *not* anti-C99. I'm just
anti-portability. When C99 becomes as widespread as C90 is now,
I shall be as delighted as anyone else, believe me.

But it isn't there yet.
 
K

Kenny McCormack

Mark F. Haigh said:



Yes, I suppose I have - and yet I am *not* anti-C99. I'm just
anti-portability.

Then why are you posting here? Haven't you read the charter/FAQ?
 
C

Chris Hills

There's no formal charter, but a de-facto one is advocated by the
"regulars".

Bollox!

ADVOCATED BY *SOME* of the regulars. Regulars who chase off any newbie
they don't like.

There are several opposing views on what is On Topic here.
The following is as good a document as any for this
subject:

No it's not. It is written with a particular veiw point and some
regulars would disagree with parts.

It has no more or less standing than any one else's view on what this NG
is about. It is certainly no replacement for a charter.
 

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
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top