]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Avoid generating incorrect warning
authorSteve Baird <baird@adacore.com>
Mon, 21 Jul 2025 23:23:20 +0000 (16:23 -0700)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Mon, 4 Aug 2025 13:04:09 +0000 (15:04 +0200)
Do not generate a warning stating that the size of a formal parameter
is 8 bits unless the size of the formal parameter is 8 bits.

gcc/ada/ChangeLog:

* freeze.adb (Freeze_Profile): Do not emit a warning stating that
a formal parameter's size is 8 if the parameter's size is not 8.

gcc/ada/freeze.adb

index dbd7cf425a293ddc7197a93d4bba969e68233dd9..afe0fda0671c4d80fc5a8c6d0a5c9b880301895d 100644 (file)
@@ -4813,6 +4813,8 @@ package body Freeze is
                  and then Convention (F_Type) = Convention_Ada
                  and then not Has_Warnings_Off (F_Type)
                  and then not Has_Size_Clause (F_Type)
+                 and then Present (Esize (F_Type))
+                 and then Esize (F_Type) = 8
                then
                   Error_Msg_N
                     ("& is an 8-bit Ada Boolean?x?", Formal);