Florian Weimer wrote:
Probably it's hard to accept for hard-code C coders that a program which generates correct machine code with all GCC versions released so far (modulo bugs in GCC) can still be illegal C and exhibit undefined behavior. IIRC, I needed quite some time to realize the full impact of this distinction.
Note that even making things implementation defined does not help the problem of learning by example from one implementation. It really is a good idea for people programming in language X to learn language X :-) Back in the days of Algol-60 absolutely everyone read the report. Then we went through an era of standards which few people read (how many fortran programmers read the fortran standard, cobol programmers read the cobol standard, c programmers read the c standard etc). A rather nice achievment with Ada is that the standard is indeed a reference book that all Ada programmers have on their shelf and even though not all have read it through, they know it is the important ultimate reference standard of what is and what is not allowed in valid programs, and you would be hard put to find a professional Ada programmer who has not frequently reached for the standard to look something up. In a big class of programmers nearly all of whom had done professional C programming a couple of years ago, only 2 out of 94 had held the C standard in their hands. It's not an easy document, but it's also not that hard, it would be nice to promote its use more!