From: "Vincent Smeets" <Nobody@No.SPAM.org>
Subject: compiler error in GNAT 3.14a1
Date: Thu, 12 Feb 2004 10:16:56 +0100
Date: 2004-02-12T10:16:56+01:00 [thread overview]
Message-ID: <402b4488$0$280$4d4ebb8e@read.news.de.uu.net> (raw)
Hallo,
I have found a compiler error in GNAT 3.14a1.
I have a record D with two components E and F. The layout of the record is
defined by a representation clause. By a typing error, I defined the
bit-range to be zero (0 .. 0). See record D2. The compiler compiles the file
without an error or warning and changes the layout of the record.
I would at least acpect a warning from the compiler.
azha:592$ cat a.ads
package A is
type B is range 0 .. 255;
for B'Size use 8;
type C is array (Integer range 1 .. 4) of B;
for C'Component_Size use 8;
type D is
record
E : C;
F : B;
end record;
for D use
record
E at 0 range 0 .. 4 * 8 - 1;
F at 4 range 0 .. 8 - 1;
end record;
type D2 is
record
E : C;
F : B;
end record;
for D2 use
record
E at 0 range 0 .. 0 * 8 - 1;
F at 4 range 0 .. 8 - 1;
end record;
end A;
azha:593$ gcc -c -gnatR2 -gnatv -gnatwa a.ads
GNAT 3.14a1 (20010503) Copyright 1992-2001 Free Software Foundation, Inc.
Compiling: a.ads (source file time stamp: 2004-02-12 08:59:47)
31 lines: No errors
Representation information for unit A (spec)
--------------------------------------------
for B'Size use 8;
for B'Alignment use 1;
for C'Size use 32;
for C'Alignment use 1;
for C'Component_Size use 8;
for D'Size use 40;
for D'Alignment use 1;
for D use record
E at 0 range 0 .. 31;
F at 4 range 0 .. 7;
end record;
for D2'Size use 72;
for D2'Alignment use 1;
for D2 use record
E at 5 range 0 .. 31;
F at 4 range 0 .. 7;
end record;
azha:594$
next reply other threads:[~2004-02-12 9:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-12 9:16 Vincent Smeets [this message]
2004-02-12 12:10 ` compiler error in GNAT 3.14a1 Preben Randhol
2004-02-13 1:17 ` Stephen Leake
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox