comp.lang.ada
 help / color / mirror / Atom feed
From: bertrand@cui.UUCP (IBRAHIM Bertrand)
Subject: is this a bug of my Ada compiler
Date: 10 Oct 88 20:34:57 GMT	[thread overview]
Message-ID: <243@cui.UUCP> (raw)

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. I thought that at least at 
elaboration time I would get a numeric_error but it compiled and ran without 
any problem. It is only if I try to compare k to another object of type T that 
I get the numeric_error exception raised.

Is it normal behaviour or is it a bug in my VADS 5.5 compiler (the SUN 
implementation) ?

Thank you for your replies,

Bertrand Ibrahim.


              to BITNET                             to EAN
from
BITNET IBRAHIM@CGEUGE51.BITNET                 bertrand%cui.unige.ch@CERNVAX
ARPA   IBRAHIM%CGEUGE51.BITNET@CUNYVM.CUNY.EDU bertrand%cui.unige.ch@ubc.csnet
UUCP                                           cernvax!cui!bertrand.uucp
UUCP                                           mcvax!cernvax!cui!bertrand.uucp
UUCP                                           cui!bertrand@cernvax.UUCP
EAN                                            bertrand@cui.unige.ch

             reply	other threads:[~1988-10-10 20:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1988-10-10 20:34 IBRAHIM Bertrand [this message]
1988-10-13 12:50 ` is this a bug of my Ada compiler Robert Firth
1988-10-13 20:02   ` Fred Hosch
1988-10-14 17:24 ` brucej
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox