public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-1855] ada: Add escape hatch to configurable run-time
@ 2023-06-15  8:02 Marc Poulhi?s
  0 siblings, 0 replies; only message in thread
From: Marc Poulhi?s @ 2023-06-15  8:02 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:70345b97934d4d998bef26a7d38c9e6a4aa8e776

commit r14-1855-g70345b97934d4d998bef26a7d38c9e6a4aa8e776
Author: Ronan Desplanques <desplanques@adacore.com>
Date:   Mon May 15 14:24:33 2023 +0200

    ada: Add escape hatch to configurable run-time
    
    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.

Diff:
---
 gcc/ada/targparm.adb | 8 ++++++++
 gcc/ada/targparm.ads | 4 ++++
 2 files changed, 12 insertions(+)

diff --git a/gcc/ada/targparm.adb b/gcc/ada/targparm.adb
index 6e753ea6aaa..d4701453995 100644
--- a/gcc/ada/targparm.adb
+++ b/gcc/ada/targparm.adb
@@ -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
diff --git a/gcc/ada/targparm.ads b/gcc/ada/targparm.ads
index 01ee492e015..212725219d7 100644
--- a/gcc/ada/targparm.ads
+++ b/gcc/ada/targparm.ads
@@ -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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-06-15  8:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-15  8:02 [gcc r14-1855] ada: Add escape hatch to configurable run-time Marc Poulhi?s

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).