]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Add null exclusion to registration of floating-point types
authorPiotr Trojanek <trojanek@adacore.com>
Tue, 18 Feb 2025 13:38:24 +0000 (14:38 +0100)
committerMarc Poulhiès <dkm@gcc.gnu.org>
Fri, 6 Jun 2025 08:37:14 +0000 (10:37 +0200)
Null exclusion both clarifies the intention of the code and allows GNAT to
eliminate runtime checks where possible (or make them fail where violated), at
least in developer builds. Code cleanup.

gcc/ada/ChangeLog:

* get_targ.ads (Register_Proc_Type): Add null exclusion.

gcc/ada/get_targ.ads

index 35cf00d73a1ae7156a71c4b48c851b5d860f9a62..4b658f10884f128bc89b82d021c8aa898aef509e 100644 (file)
@@ -113,7 +113,7 @@ package Get_Targ is
    type C_String is array (0 .. 255) of aliased Character;
    pragma Convention (C, C_String);
 
-   type Register_Type_Proc is access procedure
+   type Register_Type_Proc is not null access procedure
      (C_Name    : C_String;       -- Nul-terminated string with name of type
       Digs      : Natural;        -- Digits for floating point, 0 otherwise
       Complex   : Boolean;        -- True iff type has real and imaginary parts