Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!bloom-beacon!mit-eddie!uw-beaver!cornell!rochester!pt.cs.cmu.edu!sei!sei.cmu.edu!firth From: firth@sei.cmu.edu (Robert Firth) Newsgroups: comp.lang.ada Subject: Re: is this a bug of my Ada compiler Message-ID: <7324@aw.sei.cmu.edu> Date: 13 Oct 88 12:50:32 GMT References: <243@cui.UUCP> Sender: netnews@sei.cmu.edu Reply-To: firth@bd.sei.cmu.edu (Robert Firth) Organization: Carnegie-Mellon University, SEI, Pgh, Pa Lines: 26 In article <243@cui.UUCP> bertrand@cui.UUCP (IBRAHIM Bertrand) writes: >In the following sample code, I've been very surprised not to be warned by the >compiler that the initial value for k was out of range: procedure bug is type T is range 0..255; k: constant T := 16#FFE1#; begin null; end bug; >Even at execution time, no exception was raised. Since the constant K is never subsequently used, the compiler has probably optimised your code and deleted both K and the initial assignment to it. That is legitimate [RM 11.6 (7)], but I confess I'd rather have had a compile-time warning. [The person who thought up that rule about having to add at least as much matter as you quote was a BLOODY MORON ]