]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
ada: Add escape hatch to configurable run-time
authorRonan Desplanques <desplanques@adacore.com>
Mon, 15 May 2023 12:24:33 +0000 (14:24 +0200)
committerMarc Poulhiès <poulhies@adacore.com>
Thu, 15 Jun 2023 07:59:36 +0000 (09:59 +0200)
Before this patch, the fact that Restrictions pragmas had to fit on
a single line in system.ads was difficult to reconcile with the
80-character line limit that is enforced in that file.

The special rules for pragmas in system.ads made it impossible to us
the Style_Checks pragma to allow long Restrictions pragmas. This patch
relaxes those rules so the Style_Checks pragma can be used in
system.ads.

gcc/ada/

* targparm.adb: Allow pragma Style_Checks in some forms.
* targparm.ads: Document new pragma permission.

gcc/ada/targparm.adb
gcc/ada/targparm.ads

index 6e753ea6aaa7fa61786864f247b45905f10b2bac..d4701453995a78e7bbd6515686bef5bfa5ab1c3a 100644 (file)
@@ -660,6 +660,14 @@ package body Targparm is
             Opt.Task_Dispatching_Policy_Sloc := System_Location;
             goto Line_Loop_Continue;
 
+         --  Allow "pragma Style_Checks (On);" and "pragma Style_Checks (Off);"
+         --  to make it possible to have long "pragma Restrictions" line.
+
+         elsif Looking_At_Skip ("pragma Style_Checks (On);") or else
+           Looking_At_Skip ("pragma Style_Checks (Off);")
+         then
+            goto Line_Loop_Continue;
+
          --  No other configuration pragmas are permitted
 
          elsif Looking_At ("pragma ") then
index 01ee492e01543b47dc64ca844bd4479b31fac262..212725219d721db9359414b23c3ed9d6ca144f2b 100644 (file)
@@ -110,6 +110,10 @@ package Targparm is
    --  If a pragma Profile with a valid profile argument appears, then
    --  the appropriate restrictions and policy flags are set.
 
+   --  pragma Style_Checks is allowed with "On" or "Off" as an argument, in
+   --  order to make the conditions on pragma Restrictions documented in the
+   --  next paragraph easier to manage.
+
    --  The only other pragma allowed is a pragma Restrictions that specifies
    --  a restriction that will be imposed on all units in the partition. Note
    --  that in this context, only one restriction can be specified in a single