diff options
author | Bob Duff <duff@adacore.com> | 2019-08-19 08:36:35 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2019-08-19 08:36:35 +0000 |
commit | d403cfad2f90edf5fd8d8f6040177487ae9e167a (patch) | |
tree | 05dc28b59765f7292b2c14024c3f8786ff5ae2f5 /gcc/function.c | |
parent | eb6b9c9bcb5ac89eab098d3774e6429b6cfaeb6e (diff) | |
download | gcc-d403cfad2f90edf5fd8d8f6040177487ae9e167a.zip gcc-d403cfad2f90edf5fd8d8f6040177487ae9e167a.tar.gz gcc-d403cfad2f90edf5fd8d8f6040177487ae9e167a.tar.bz2 |
[Ada] Process type extensions for -gnatw.h
This patch enables gap detection in type extensions.
With the -gnatw.h switch, on 64-bit machines,
the following test should get warnings:
gcc -c gaps.ads -gnatw.h
gaps.ads:16:07: warning: 48-bit gap before component "Comp2"
gaps.ads:17:07: warning: 8-bit gap before component "Comp3"
package Gaps is
type Integer_16 is mod 2**16;
type TestGap is tagged record
Comp1 : Integer_16;
end record;
for TestGap use record
Comp1 at 0 + 8 range 0..15;
end record;
type TestGap2 is new TestGap with record
Comp2 : Integer_16;
Comp3 : Integer_16;
end record;
for TestGap2 use record
Comp2 at 08 + 8 range 0..15;
Comp3 at 11 + 8 range 0..15;
end record;
end Gaps;
2019-08-19 Bob Duff <duff@adacore.com>
gcc/ada/
* sem_ch13.adb (Record_Hole_Check): Procedure to check for holes
that incudes processing type extensions. A type extension is
processed by first calling Record_Hole_Check recursively on the
parent type to compute the bit number after the last component
of the parent.
From-SVN: r274653
Diffstat (limited to 'gcc/function.c')
0 files changed, 0 insertions, 0 deletions