Jeff said:
Hi Richard Herring,
I mentioned,
" Dividing by zero with release-complied code
will trigger no error, and no exceptions,
provided that you are not in the debugger. "
And you asked me,
" Where in the standard do you find that ? "
My clients are using my code, not your standards.
Wise programmers plan, just a little, for the future. The less
standard-compliant your code, the more likely it will break when you change
compiler vendors, or compiler versions, or even the compilation options.
This ensure clients may come back for more.
The C languages are "portable assembler". They provide a wide range of ways
to create "undefined behavior", meaning the compiler vendor is not required
to guarantee any particular result if a programmer crosses a very obvious
line. Things like double-deleting allocated memory, writing off the end of
an array, etc. Part of becoming proficient, and less than dangerous, in the
C languages is learning the complete list of undefined behaviors, and the
best practices that avoid them. That's what this newsgroup means each time
it slings out the loaded word "standard".
The fastest way to become non-proficient is to rely on "but my compiler
liked it". That attitude causes a skyrocketing rate of bugs, all
extraordinarily hard to detect and debug. Programmers who learn and follow a
sane subset don't get that problem.