From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4fb6ec6cd054de65 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-03-11 08:35:44 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!headwall.stanford.edu!hub1.nntpserver.com!xmission!hammer.uoregon.edu!skates!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: constrained subtypes Date: 11 Mar 2002 11:16:37 -0500 Organization: NASA Goddard Space Flight Center Message-ID: References: <3c8cc63b$1@pull.gecm.com> NNTP-Posting-Host: anarres.gsfc.nasa.gov Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: skates.gsfc.nasa.gov 1015863722 27677 128.183.220.71 (11 Mar 2002 16:22:02 GMT) X-Complaints-To: dscoggin@cne-odin.gsfc.nasa.gov NNTP-Posting-Date: 11 Mar 2002 16:22:02 GMT User-Agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 Xref: archiver1.google.com comp.lang.ada:21064 Date: 2002-03-11T16:22:02+00:00 List-Id: "George Stevens" writes: > We're trying to use subtypes of base integer, constraining them 1 .. 8 > (i.e. static values) > When we use these types in a case statement, covering values 1 - 8, the > Aonix Ada compiler (7.1.2) complains that we haven't defined "others". > However, we shouldn't need to, as all cases are within the constrained > limits. I've looked at Programming in Ada 95 - Barnes (p106) which seems to > suggest that we're doing the right thing language-wise, so long as the range > limits are static types. > > Is this a compiler funny or an Ada funny? You'll have to show the code; if you do this correctly, all Ada compilers support it (I've done it on both Aonix and GNAT). -- -- Stephe