r274653 - in /trunk/gcc/ada: ChangeLog sem_ch13...

pmderodat@gcc.gnu.org pmderodat@gcc.gnu.org
Mon Aug 19 08:36:00 GMT 2019


Author: pmderodat
Date: Mon Aug 19 08:36:35 2019
New Revision: 274653

URL: https://gcc.gnu.org/viewcvs?rev=274653&root=gcc&view=rev
Log:
[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.

Modified:
    trunk/gcc/ada/ChangeLog
    trunk/gcc/ada/sem_ch13.adb



More information about the Gcc-cvs mailing list