#276227 Legal program rejected, packed array of booleans

Package:
gnat-12
Source:
gcc-12
Description:
GNU Ada compiler
Submitter:
Date:
2024-10-28 17:39:04 UTC
Severity:
normal
Tags:
#276227#5
Date:
2004-10-12 18:34:52 UTC
From:
To:

#276227#18
Date:
2009-01-02 19:07:48 UTC
From:
To:
found  276227 4.3.2-2
thanks

The compiler message is different with 4.3.2-2 than from the original
report. Now it reads

teg@burken:~/test/ada/bugs/276227$ gnatmake test_124.ads
gcc-4.3 -c test_124.ads
test_124.ads:12:36: size for "T1_arr_constrained" too small, minimum
allowed is 256
test_124.ads:22:36: size for "T2_arr_constrained" too small, minimum
allowed is 248
gnatmake: "test_124.ads" compilation error

#276227#29
Date:
2009-08-30 16:48:19 UTC
From:
To:
same messages as 4.3.2-2 :
gcc-4.4 -c test_124.ads
test_124.ads:12:36: size for "T1_arr_constrained" too small, minimum
allowed is 256
test_124.ads:22:36: size for "T2_arr_constrained" too small, minimum
allowed is 248

Does the pack part can apply to the new type ? What does th RM say about
this ?

#276227#38
Date:
2011-08-31 12:46:08 UTC
From:
To:
reassign 276227 gnat-4.6
found 276227 4.6.1-5
thanks

Since both messages are now coherent, I propose to test one single type.

package Test_124 is
   type T is range 1 .. 32;
   type T_arr_unconstrained is array (T range <>) of boolean;
   type T_arr_constrained is new T_arr_unconstrained (T);
   pragma pack (T_arr_unconstrained);
   for T_arr_constrained'size use 32;
end Test_124;

gnatmake test_124
gcc-4.6 -c test_124.ads
test_124.ads:6:35: size for "T_arr_constrained" too small, minimum allowed is 256
gnatmake: "test_124.ads" compilation error