]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: freeze.adb: do not emit error on non-aligned component in CodePeer_Mode
authorGhjuvan Lacambre <lacambre@adacore.com>
Fri, 9 May 2025 09:20:18 +0000 (11:20 +0200)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Tue, 1 Jul 2025 08:29:41 +0000 (10:29 +0200)
These errors hinder analysis of non-GNAT code and are not useful to the
user as CodePeer does not care about alignment.

gcc/ada/ChangeLog:

* freeze.adb (Freeze_Record_Type): Check for CodePeer_Mode.

gcc/ada/freeze.adb

index cf01102f073ce2628130545dee540f3c89e3bcbe..be2115a90867a2cb80b7d29502f412b6823dbaab 100644 (file)
@@ -5451,9 +5451,12 @@ package body Freeze is
                      Set_Must_Be_On_Byte_Boundary (Rec);
 
                      --  Check for component clause that is inconsistent with
-                     --  the required byte boundary alignment.
+                     --  the required byte boundary alignment. Do not do this
+                     --  in CodePeer_Mode, as we do not have sufficient info
+                     --  on size and representation clauses.
 
-                     if Present (CC)
+                     if not CodePeer_Mode
+                       and then Present (CC)
                        and then Normalized_First_Bit (Comp) mod
                                   System_Storage_Unit /= 0
                      then