https://gcc.gnu.org/g:623a5d30a55521869afc1f398858a7736eea3b80

commit r16-6635-g623a5d30a55521869afc1f398858a7736eea3b80
Author: Steve Baird <[email protected]>
Date:   Fri Dec 19 14:08:30 2025 -0800

    ada: Ada.Containers.Bounded_Indefinite_Holders follow-up.
    
    Suppress warnings generated for a Bounded_Indefinite_Holders instance
    when compiled for a 32-bit target. The warnings are not useful because
    the construct being flagged is in code that is dead (for that instance).
    
    gcc/ada/ChangeLog:
    
            * libgnat/a-cbinho.ads: add Warnings pragmas.

Diff:
---
 gcc/ada/libgnat/a-cbinho.ads | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gcc/ada/libgnat/a-cbinho.ads b/gcc/ada/libgnat/a-cbinho.ads
index 0aaacd356aa0..ae7d112318af 100644
--- a/gcc/ada/libgnat/a-cbinho.ads
+++ b/gcc/ada/libgnat/a-cbinho.ads
@@ -187,6 +187,8 @@ private
    --  overhead except for aforementioned possibility of an alignment-related
    --  gap between some prefix data and the object itself.
 
+   pragma Warnings (Off); -- avoid warnings for exceptions raised in dead code
+
    function Max_Allocation_Overhead_In_Storage_Elements return Storage_Count is
      (if Element_Size_In_Storage_Elements >= Long_Integer (Integer'Last) then
          --  If the more precise computation in the else-arm (below) could
@@ -208,6 +210,8 @@ private
    --  though the earlier (earlier at run-time) size check in Replace_Element
    --  passed. A GNAT-defined attribute could eliminate this issue.
 
+   pragma Warnings (On);
+
    --  Compute extra amount needed for space requested for an allocator
    --  (specifically, in a call to Allocate_From_Subpool) in addition to
    --  the space required for the allocated object itself.

Reply via email to