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,aee8ed05a978aff9 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,UTF8 Path: g2news1.google.com!news1.google.com!news.glorb.com!news-stoc.telia.net!217.209.241.210.MISMATCH!news-stod.telia.net!telia.net!masternews.telia.net.!newsb.telia.net.POSTED!not-for-mail From: =?UTF-8?B?QmrDtnJuIFBlcnNzb24=?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.1) Gecko/20031114 X-Accept-Language: sv, sv-se, sv-fi, en-gb, en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Is this definition legal? References: <87mzznjg5z.fsf@insalien.org> In-Reply-To: <87mzznjg5z.fsf@insalien.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Message-ID: Date: Sun, 19 Sep 2004 14:07:09 GMT NNTP-Posting-Host: 217.209.116.179 X-Complaints-To: abuse@telia.com X-Trace: newsb.telia.net 1095602829 217.209.116.179 (Sun, 19 Sep 2004 16:07:09 CEST) NNTP-Posting-Date: Sun, 19 Sep 2004 16:07:09 CEST Organization: Telia Internet Xref: g2news1.google.com comp.lang.ada:3845 Date: 2004-09-19T14:07:09+00:00 List-Id: Ludovic Brenta wrote: > Whether or not your code is legal, a bug box is a bug. I would be > interested in a short test case for each of your issues (one for the > bug box upon declaring a Character_Encoding without an initialiser; That one is easy: with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Interfaces; use Interfaces; package Declaration_Bug_Box is type Known_OS is (NT, OS2, Linux); This_OS : constant Known_OS :=3D Linux; type Encoding_ID is (UTF_8_ID, ASCII_ID, Latin_1_ID); type Unified_Encoding_Record (Known : Boolean; OS : Known_OS) is reco= rd case Known is when True =3D> Which : Encoding_ID; when False =3D> case OS is when Linux =3D> Name : Unbounded_String; when NT | OS2 =3D> Number : Unsigned_16; end case; end case; end record; type Character_Encoding (Known : Boolean :=3D False) is new Unified_Encoding_Record (Known =3D> Known, OS =3D> This_OS); Trigger_Bug : Character_Encoding; end Declaration_Bug_Box; > one for the conversion that alters OS, and one where the conversions > raises Constraint_Error. Those are difficult to reproduce. I think they depend on uninitialized=20 memory and I haven't quite figured out which constant, variable or=20 parameter it is that doesn't get properly initialized. I'd need a way to = reliably "pre-initialize" memory - that is, to make sure that the right=20 kind of garbage is present before a variable or constant is created. I'm = working on it. --=20 Bj=C3=B6rn Persson PGP key A88682FD omb jor ers @sv ge. r o.b n.p son eri nu