R
Richard Heathfield
Adam Warner said:
I disagree.
Reality check - this is comp.lang.c. [OT stuff about Java snipped] The C
language definition discusses various situations where a translator /must/
diagnose a problem, and leaves it up to implementations to diagnose other
situations as they will. Thus, whether statically determinable array bounds
violations are diagnosed is purely a "quality of implementation" issue.
Just as I wouldn't criticise my wife for failing to tell me to fasten my
seatbelt, so I don't criticise my compiler for failing to tell me about
buffer overruns. Remembering to fasten my seatbelt is /my/ job, and I can
take care of it myself, but of course someone needs to keep an eye on the
kids in the back. Avoiding buffer overruns is /my/ job, and I can take care
of it myself, but of course someone needs to keep an eye on the Java kids
in the back.
Both you and Richard are snipping too much context.
I disagree.
Exactly! Point 1: I am not confusing a language with implementations
of that language because the Java Language Specification mandates bounds
checking semantics:
Reality check - this is comp.lang.c. [OT stuff about Java snipped] The C
language definition discusses various situations where a translator /must/
diagnose a problem, and leaves it up to implementations to diagnose other
situations as they will. Thus, whether statically determinable array bounds
violations are diagnosed is purely a "quality of implementation" issue.
Yet I still inhabit reality where the culture of C-is-a-portable-assembly-
language invariably eschews code safety. In your previous reply in this
thread you didn't even care about a basic static type definition check
that would have warned about a potential buffer overrun. A warning with no
runtime overhead implications and yet you still didn't care.
Just as I wouldn't criticise my wife for failing to tell me to fasten my
seatbelt, so I don't criticise my compiler for failing to tell me about
buffer overruns. Remembering to fasten my seatbelt is /my/ job, and I can
take care of it myself, but of course someone needs to keep an eye on the
kids in the back. Avoiding buffer overruns is /my/ job, and I can take care
of it myself, but of course someone needs to keep an eye on the Java kids
in the back.