CBFalconer said:
I belong to a fanatical religion which specifies that one should
never fail to tuck their legs beneath their chair while typing. So
I pick up a 20 pound weight, normally used to power a grandfather
clock, hold out in front of my knees, and drop it.
LO and BEHOLD, I don't break any toes. I have followed the
standards of my religion, and the system works. It totally avoids
any trips to the hospital, doctors, etc. attributable to dropping
grandfather clock weights.
Let's assume further that dropping this 20 pound weight serves some
actual purpose.
If I tell you, without qualification, that dropping a 20 pound weight
"does not work", you can demonstrate for me that it does in fact work
for you. If I persist in saying that it "does not work", you can
reasonably tell me that I am either mistaken or lying.
If, on the other hand, I tell you that it won't *necessarily* work, or
that it's not guaranteed to work, then I'll be perfectly correct. And
you're still free to drop your 20 pound weight as long as you don't
drop it on my toes.
However, my co-worker belongs to a different religion. When he
drops that weight he fairly regularly breaks toes (his own and
others).
I claim his problem is not following the standard.
And if you had told him that "his problem is not following the
standard", you would have been on firm ground.
Leaving the metaphor and going back to reality, the code being
considered assumed that a 0 value returned by system() indicates that
the command ran successfully. There are three possible things the
standard could have said about this assumption:
A: This is guaranteed to work. If system() returns 0, the command
succeeded; if system() returns any other value, the command failed.
B: This may or may not work. system() returns an
implementation-defined result. A particular implementation might
choose to assign the meaning "success" to 0, and "failure" to other
values, or it might assign any other arbitrary set of meanings.
C: This is guaranteed not to work. An implementation on which a
successful call to system() returns 0 and an unsuccessful call
returns some other value is non-conforming.
The truth, as I'm sure we all know, is B. By saying, without
qualification, that it does not work, you are either falsely claiming
the truth of C, or carelessly failing to make the very important
distinction between B and C.
You seem to
claim that he deserves no calumny for that failure. I have no wish
to pay for his medical treatment. You seem to volunteer for that.
Nobody has said any such thing. I've seen nobody in this thread claim
that the code is anything other than non-portable. There's been some
disagreement on how important this is, and nearly universal
disagreement with the way you chose to state it.
I ordinarily wouldn't spend so much time on a dispute over wording,
but you've made this kind of claim repeatedly.