(e-mail address removed) said:
It's not difficult, but someone can also be wrong in meaningless ways...
No. Either someone is wrong, or not. It's *that* simple.
...and that's a good example.
Look, I feel like I'm arguing with a complete idiot,
Finally, something we have in common.
and you're going to
have to work pretty hard to change my mind. You *ASKED* for an explanation
of "de facto", and I gave you one, complete with an illustration. What's
more, it is clear that the distinction is highly relevant.
Yes, you gave me an explanation, and I understood. What I mean is that
the words "de jure" and "de facto," in the way you used them to
describe the government law, is different from the way you used them
to describe the two standards, and makes no sense.
*IN LAW*, C99 is the current Standard. *IN PRACTICE*, here you are,
advocating C99 and saying that C90 is obsolete, but according to your last
article you don't even have a conforming C99 implementation on your
desktop machine!
Looks like it's hard for you to understand simple facts. What makes
you think there can only be *one* standard? Like I said, they're
*both* C standards. C99 is the *current* standard. And no, I never
said C89 was obsolete. In fact, I'd recommend using it for
applications that need more portability than C99 offers, or to
maintain legacy code that uses it. And how do you know I don't have a
conforming C99 implementation in my desktop machine? The fact that I
use GCC doesn't mean I must *only* have GCC on my machine. I simply
don't think that "conforming" == "perfect", as you seem to think.
De jure, C99 is the C Standard. De facto, C90 is the C Standard.
For the third time: They're *both* C standards. C99 is the *current*
standard.
Is that so hard to understand for you? I mean, I know you struggled with
the terminology, but I have now explained that. Do you *have* to struggle
with the common sense, too?
It seems to me your common sense and my common sense are very
different.
Are you really so foolish as to believe
there's any point in trying to write code that adheres to a Standard to
which not even your own implementation conforms?
What makes you think I can only have *one* implementation? Besides,
while GCC doesn't strictly conform to the standard, they've clearly
marked what features are supported and which aren't, and the failures
are minor. So I wouldn't be "foolish" even if I had *only* GCC
available to me.
It proves the point.
The ones I've worked with are red-hot on portability. I've done a lot of
work on OS390 projects, and normal practice is to write it on the PC, get
it working, then put it straight up on the mainframe for testing. The
ideal is for no code changes to be required on the mainframe - this is
rarely attained, but any such changes that do turn out to be necessary are
made *ON THE PC*, tested there, and then ported up.
Again, that's a lot of ifs. You're talking through your nose and hoping
that the facts support you, instead of checking and presenting the facts.
What facts are you referring to? I stated that I don't necessarily
need to know exactly on which platforms I can compile code, depending
on my portability needs. That's the fact.
Well, there's a shock. Nevertheless, there's a lot more to life than Vista.
I don't use Vista. Anyway, not everyone has the same interests as you.
That's a change from your last article, where you claimed you did not use
C99 for your desktop. I don't count non-conforming implementations, since
they don't implement C99.
They do implement C99, just not completely. Hence the "non-conforming
implementation" phrase. Thus, I do use C99 for my desktop, despite
your extreme misinterpretation of my post.
From your own claim that you don't use a C99 implementation.
I do use one. Where do you get that "you don't use a C99
implementation"?
That's exactly what you're discussing, when you talk about non-conformiong
implementations.
No. In fact, we're even discussing C here. We're discussing
implementations. So we're discussing neither "ISO C," nor "notquiteISO
C."
Usability is important, but rarely an issue.
It is for me.
Compilers are normally pretty
easy to use. But if the implementation *doesn't conform*, then you can't
trust it to run code that wasn't tailored specifically for it.
You can trust it if the implementation has clearly marked the features
it has implemented, and the ones it hasn't, as is the case for GCC.
It's a similar case for conforming implementations: if it claims to
conform, you can safely use everything the standard defines and as it
defines it. If it doesn't conform, you have to see the documentation
to find out what you can use safely and what not.
I think you'll find a wide body of support for the opinion that compilers
ought to be able to translate programs according to spec, if only you're
prepared to take your blinkers off.
Likewise, many people will agree that compiler-specific extensions are
generally useful. Also, I forgot to mention on the previous post: "non-
conforming" != "incorrect".
Actually, very often the compiler *doesn't* make that decision. For
example, consider the following code:
void foo(unsigned int *a, unsigned int *b)
{
*a += ++*b;
}
This code is standalone, in the sense that one could legally compile it as
a separate translation unit. Do you see any reason why a compiler should
decide to insert extra instructions into this function's translated code
to guard against undefined behaviour, especially when the compiler has no
reason to believe that the function will ever be invoked incorrectly?
But let's look at a more obvious example of undefined behavior:
int i;
int *p = &i;
p++;
In this case, it's obvious to the compiler that the code invokes
undefined behavior, and the compiler is faced with the decision of
what to do: Should it not increment p? Should it increment it and hope
for the best? Should it generate instructions to erase all files in
the hard disk? I'm not sure about the first two, but the third is
legal according to the standard (as you already agreed).
At the very least, it would be a valuable teaching tool.
But not everyone's on the learning phase, and some people need
productivity. And a compiler like that would be nothing but useless to
a serious programmer.
Sebastian