diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-05-06 09:13:27 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-05-06 09:13:27 +0000 |
commit | e471111534885ab180ed1bf2699195d26b2a8222 (patch) | |
tree | c7250828c1aabe6ec694d4257049d9c7f3f268a6 /gcc/ada/gnat_rm.texi | |
parent | 549be29125e4771c48d39d6755c6a6700ac3ff9b (diff) | |
download | gcc-e471111534885ab180ed1bf2699195d26b2a8222.tar.gz |
2009-05-06 Robert Dewar <dewar@adacore.com>
* freeze.adb (Freeze_Record_Type): Implement Implicit_Packing for
records
* gnat_rm.texi:
Add documentation for pragma Implicit_Packing applied to record
types.
2009-05-06 Ed Schonberg <schonberg@adacore.com>
* sem.adb (Walk_Library_Items): Place all with_clauses of an
instantiation on the spec, because late instance bodies may generate
with_clauses for the instance body but are inserted in the instance
spec.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@147158 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/gnat_rm.texi')
-rw-r--r-- | gcc/ada/gnat_rm.texi | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/gcc/ada/gnat_rm.texi b/gcc/ada/gnat_rm.texi index 0f7bd74b0a0..0e126c35aa2 100644 --- a/gcc/ada/gnat_rm.texi +++ b/gcc/ada/gnat_rm.texi @@ -2409,7 +2409,8 @@ pragma Implicit_Packing; @noindent This is a configuration pragma that requests implicit packing for packed arrays for which a size clause is given but no explicit pragma Pack or -specification of Component_Size is present. Consider this example: +specification of Component_Size is present. It also applies to records +where no record representation clause is present. Consider this example: @smallexample @c ada type R is array (0 .. 7) of Boolean; @@ -2431,6 +2432,21 @@ specify the exact size that corresponds to the length of the array multiplied by the size in bits of the component type. @cindex Array packing +Similarly, the following example shows the use in the record case + +@smallexample @c ada +type r is record + a, b, c, d, e, f, g, h : boolean; + chr : character; +end record; +for r'size use 16; +@end smallexample + +@noindent +Without a pragma Pack, each Boolean field requires 8 bits, so the +minimum size is 72 bits, but with a pragma Pack, 16 bits would be +sufficient. The use of pragma Implciit_Packing allows this record +declaration to compile without an explicit pragma Pack. @node Pragma Import_Exception @unnumberedsec Pragma Import_Exception @cindex OpenVMS |