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=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.66.182.166 with SMTP id ef6mr21876841pac.42.1428435957647; Tue, 07 Apr 2015 12:45:57 -0700 (PDT) X-Received: by 10.140.48.11 with SMTP id n11mr140935qga.35.1428435957311; Tue, 07 Apr 2015 12:45:57 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!news.glorb.com!border1.nntp.dca1.giganews.com!nntp.giganews.com!l13no2192620iga.0!news-out.google.com!k20ni30qgd.0!nntp.google.com!z60no201935qgd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Tue, 7 Apr 2015 12:45:56 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=75.99.9.146; posting-account=s89PEgoAAABHs2ETFyOrCeTQVQJAfzKq NNTP-Posting-Host: 75.99.9.146 References: <0817bf94-0550-40c4-ba5f-f2ecd6383dbb@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: GNAT "alignment value must be positive" From: marciant@earthlink.net Injection-Date: Tue, 07 Apr 2015 19:45:57 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: news.eternal-september.org comp.lang.ada:25454 Date: 2015-04-07T12:45:56-07:00 List-Id: On Tuesday, April 7, 2015 at 2:47:01 PM UTC-4, Jeffrey Carter wrote: > So zero should be allowed in this obsolescent form as well. > > If GNAT is rejecting zero when allowed by these rules > then it would seem to be a compiler error. I'm linking that also. If I do not see any better explanation here then I will write a note to AdaCore. Also here is a "made up" package that exhibits the issue and the compilation messages that GNAT puts out (I also did some editing after I pasted to this message and hopefully did not mess up the code-message correspondence): package Nonaligned_Type_Definitions is type Nonaligned_Record_Component_0 is range -4 .. 4; for Nonaligned_Record_Component_0'size use 4; for Nonaligned_Record_Component_0'alignment use 0; type Nonaligned_Record_Component_2 is range -32768 .. 32767; for Nonaligned_Record_Component_2'size use 16; for Nonaligned_Record_Component_2'alignment use 0; type Nonaligned_Record is record Component_0a : Nonaligned_Record_Component_0; Component_0b : Nonaligned_Record_Component_0; Component_2 : Nonaligned_Record_Component_2 range 0..9999; end record; for Nonaligned_Record use record at mod 0; -- ignoring at 0 range 0 .. 0 Component_0a at 0 range 1 .. 4; -- ignoring at 0 range 5 .. 7 Component_0b at 0 range 8 .. 11; -- ignoring at 0 range 12 .. 15 Component_2 at 2 range 0 .. 15; end record; for Nonaligned_Record'size use 32; end Nonaligned_Type_Definitions; GNAT output: Nonaligned_Type_Definitions.ads:5:53: alignment value must be positive Nonaligned_Type_Definitions.ads:9:54: alignment value must be positive Nonaligned_Type_Definitions.ads:20:17: alignment value must be positive gnatmake: "Nonaligned_Type_Definitions.ads" compilation error