]> gcc.gnu.org Git - gcc.git/commitdiff
ada: SPARK rule changed on functions with side effects
authorYannick Moy <moy@adacore.com>
Thu, 21 Dec 2023 16:38:21 +0000 (17:38 +0100)
committerMarc Poulhiès <poulhies@adacore.com>
Tue, 7 May 2024 07:55:51 +0000 (09:55 +0200)
SPARK RM definition of function with side effects now makes them
implicitly volatile functions.

gcc/ada/

* sem_util.adb (Is_Volatile_Function): Return True on functions
with side effects.

gcc/ada/sem_util.adb

index 18c9de05cf9c963531958bf5ba5d064eabe4bff4..3af029fd9a31f11512a14de3d052222b898dc163 100644 (file)
@@ -21226,6 +21226,11 @@ package body Sem_Util is
       then
          return True;
 
+      --  A function with side-effects is volatile
+
+      elsif Is_Function_With_Side_Effects (Func_Id) then
+         return True;
+
       --  Otherwise the function is treated as volatile if it is subject to
       --  enabled pragma Volatile_Function.
 
This page took 0.094621 seconds and 5 git commands to generate.