]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Ada.Containers.Bounded_Indefinite_Holders follow-up.
authorSteve Baird <baird@adacore.com>
Fri, 19 Dec 2025 22:08:30 +0000 (14:08 -0800)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Fri, 9 Jan 2026 10:57:21 +0000 (11:57 +0100)
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.

gcc/ada/libgnat/a-cbinho.ads

index 0aaacd356aa0a0bb1ecd6d61786064f8365140df..ae7d112318afd01847e7269be45a7bd6ad337de5 100644 (file)
@@ -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.