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-Thread: 103376,fc8384b47d495708 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!not-for-mail From: "Nick Roberts" Newsgroups: comp.lang.ada Subject: Re: Should be getting a constraint error in this code Date: Sun, 25 Jul 2004 16:14:12 +0100 Message-ID: References: <5281838.OJeT1fiqLc@linux1.krischik.com> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: news.uni-berlin.de rWkdmcXe7fUK8ComKs9tRQnOIUiyD9LvdVGioGb7qKHfJWBog= User-Agent: Opera M2/7.51 (Win32, build 3798) Xref: g2news1.google.com comp.lang.ada:2378 Date: 2004-07-25T16:14:12+01:00 List-Id: On Sun, 25 Jul 2004 15:54:09 +0200, Martin Krischik wrote: > Well observed! Yes! > But since he used a range and not a mod I would consider it a > bug within the GNAT compiler. I was surprised by GNAT's behaviour here, but I think we have to stop short of calling it a bug for two reasons: (1) since assigning an invalid value in the scope of pragma Suppress(Range_Check), as is effectively the case here, is a bounded error, GNAT's subsequent behaviour is entitled to be wrong; (2) since the type was declared with a lower bound of 0, it seems passable (if a bit weird) for T'Image to be implemented using the same algorithm as for an unsigned byte. -- Nick Roberts