This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
ada/9087: Component_Size for packed array returns wrong values
- From: adi at drcomp dot erfurt dot thur dot de
- To: gcc-gnats at gcc dot gnu dot org
- Date: 28 Dec 2002 23:22:09 -0000
- Subject: ada/9087: Component_Size for packed array returns wrong values
- Reply-to: adi at drcomp dot erfurt dot thur dot de
>Number: 9087
>Category: ada
>Synopsis: Component_Size for packed array returns wrong values
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sat Dec 28 15:26:00 PST 2002
>Closed-Date:
>Last-Modified:
>Originator: adi@drcomp.erfurt.thur.de
>Release: gcc version 3.4 20021220 (experimental)
>Organization:
>Environment:
i586-pc-linux-gnu
>Description:
By applying a pragma Pack to an unconstrained array of (e.g. boolean) the output of Component_Size for the array's subtype is
wrong.
According to this, the calculated 'Size for the whole array is
wrong as well.
>How-To-Repeat:
Compile the attached file. As you can see the array is really packed (the elements 1 and 5 are within the same byte), but the read-access to Component_Size returned the wrong value, 8. It should return 1 here.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: application/octet-stream; name="karl.adb"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="karl.adb"
d2l0aCBBZGEuVGV4dF9JTzsgdXNlIEFkYS5UZXh0X0lPOwp3aXRoIFN5c3RlbTsgdXNlIFN5c3Rl
bTsKCnByb2NlZHVyZSBrYXJsIGlzCiAgIHR5cGUgdW5jb25zdHJhaW5lZF9hcnJheSBpcyBhcnJh
eSAoUG9zaXRpdmUgcmFuZ2UgPD4pIG9mIEJvb2xlYW47CiAgIGZvciB1bmNvbnN0cmFpbmVkX2Fy
cmF5J0NvbXBvbmVudF9TaXplIHVzZSAxOwoKICAgcHJhZ21hIFBhY2sgKHVuY29uc3RyYWluZWRf
YXJyYXkpOwogICB0eXBlIHVjc19hcnJheV9wdHIgaXMgYWNjZXNzIHVuY29uc3RyYWluZWRfYXJy
YXk7CiAgIEEgOiB1Y3NfYXJyYXlfcHRyIDo9IG5ldyB1bmNvbnN0cmFpbmVkX2FycmF5ICgxIC4u
IDEwMCk7CgpiZWdpbgogICBQdXRfTGluZSAoSW50ZWdlcidJbWFnZSAodW5jb25zdHJhaW5lZF9h
cnJheSdDb21wb25lbnRfU2l6ZSkpOwoKICAgaWYgKEEgKDEpJ0FkZHJlc3MgPSBBICg1KSdBZGRy
ZXNzKSB0aGVuCiAgICAgIFB1dF9MaW5lICgiQSAoMSkgYW5kIEEgKDUpIGFyZSB3aXRoaW4gdGhl
IHNhbWUgYnl0ZSIpOwogICBlbmQgaWY7CmVuZCBrYXJsOwo=