Gabriel Dos Reis wrote:
Then, one wonders why the GNAT is not bug free ;-p
Making programs bug free has more to it than understanding the language you are writing in, but it is a useful step forward to avoid problems that come from simply not knowing the rules of the language you are writing in (I can't guarantee that GNAT is bug free in that regard, but I can't remember a case where a bug stemmed from this source).
| 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 oh, so it suffices to have it? Not to understand it?
Well it's not a binary issue. Sure, there are parts of the Ada standard that are difficult even for me, and certainly I would not expect a typical Ada programmer to be able to read and understand all if it. On the other hand, large parts are accessible, and, much more important, are in practice accessed.
The issue is whether they need to become expect in red herring or just know how to write good and correct programs. Interestingly, backis the old days K&R put emphasis on how to write good and useful programs rather than academic exercise in "undefined behaviour".
Actually K&R, which of course is definitely NOT a standard, and did indeed leave a lot of things undefined, not deliberately, but just by imprecision or omission, is, nevertheless, more precise than people think, and did introduce the notion of undefined constructs. I find it surprising that you would disagree with the propoosition that more C programmers should be familiar with the C standard. And I must say, that if you think the worry about undefined behavior is academic, I have to strongly disagree. You may be able to take this attitude as a programmer who stays away from marginal cases, but compiler writers have no choice but to worry about the marginal cases and get them right, since one programmers marginal case is another programmers normal paradigm.
-- Gaby