Hello,
See here:
www.open-std.org/.../C99RationaleV5.10.pdf
Is it possible that "Jack Sprat", the staunch defender of the C standard as the ultimate reference when writing programs, missed the following statement?
C code can be non-portable. Although it strove to give programmers the opportunity to write truly portable programs, the C89 Committee did not want to force programmers into writing portably, to preclude the use of C as a “high-level assembler”: the ability to write machine- 35 specific code is one of the strengths of C. It is this principle which largely motivates drawing the distinction between strictly conforming program and conforming program (§4).
this is precisely what Per Westermark has been saying. Exactly what Erik Malund has been saying. Remember: Jack Sprat claims often that writing a program that complies with the C standard is a GUARANTEE for its correct functioning.
"something that is fully done to the acme standard is guaranteed to work on devices that fully follow the acme standard DOH!"
Only if you are very careful in your understanding and interpretation of the meaning of "work"!
Again, this code is fully in accordance with the 'C' standard:
if( x=0 ) { // Programmer wants this code executed when x has the value zero } else { // Programmer wants this code executed when x has values other than zero }
And it will "work" in accordance with the 'C' standard - but that will not be the same as "working" in accordance with the programmer's intention!
The code will do what the programmer said - but that is not what the programmer wanted!
"written to the C standard and do not rely on compiler unique features"
But the 'C' standard specifically specifies certain features as implementation-defined!
"written to the C standard and do not rely on compiler unique features" will be portable
you missed that bit
Oh dear, here we go again.
"The world of idiots is full of professionals."
Magnus Tucker.
BEng (Hons).
cannot we just all get along?
Tammy stated in the original post: "Remember: Jack Sprat claims often that writing a program that complies with the C standard is a GUARANTEE for its correct functioning."
it is clear that
1) writing a program that complies with the C standard is NOT a guarantee for its correct functioning;
2) Jack Sprat didn't say what Tammy said he said.
we all are arguing about the falsehood of a fictional statement.
so let's drop Tammy to its mommy and move on from here.