aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2019-09-17 08:02:46 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2019-09-17 08:02:46 +0000
commit1e0a3cc4ca87b57b2a9b8a02ff20bacdce6146a3 (patch)
tree039f8d96bb9784456ead1cd055ec292e85f65287
parent7afbd9419f78de69a9bbbd90ad10e38f4ed77d65 (diff)
downloadgcc-1e0a3cc4ca87b57b2a9b8a02ff20bacdce6146a3.zip
gcc-1e0a3cc4ca87b57b2a9b8a02ff20bacdce6146a3.tar.gz
gcc-1e0a3cc4ca87b57b2a9b8a02ff20bacdce6146a3.tar.bz2
[Ada] Fix ineffective -gnatyN for separate compilation units
This fixes a recent regression introduced in the machinery giving style warnings: the -gnatyN switch no longer cancels an earlier -gnaty switch for separate compilation units. Running this command: gcc -c slib.adb -gnatyaAbcefhiIklmM25OnprStux -gnatyN On the following sources: package Slib is procedure I_Am_Short; end Slib; with Ada.Text_IO; use Ada.Text_IO; package body Slib is -- have a long line here as well. procedure I_Am_Short is separate; end Slib; separate (Slib) procedure I_Am_Short is begin Put_Line ("......................................................."); end I_Am_Short; Should execute silently. 2019-09-17 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * sem.adb (Do_Analyze): Save Style_Check_Max_Line_Length on entry and restore it on exit instead of recomputing it. From-SVN: r275794
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/sem.adb5
2 files changed, 8 insertions, 2 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 6ceb7ae..8f4d57e 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,8 @@
+2019-09-17 Eric Botcazou <ebotcazou@adacore.com>
+
+ * sem.adb (Do_Analyze): Save Style_Check_Max_Line_Length on
+ entry and restore it on exit instead of recomputing it.
+
2019-09-17 Tom Tromey <tromey@adacore.com>
* exp_dbug.ads: Update character type comment.
diff --git a/gcc/ada/sem.adb b/gcc/ada/sem.adb
index 2e99531..2967a18 100644
--- a/gcc/ada/sem.adb
+++ b/gcc/ada/sem.adb
@@ -1360,7 +1360,8 @@ package body Sem is
-- unconditionally, and has no restore mechanism, because it is
-- intended as a lowest-level Pure package.
- Saved_ML : constant Int := Style_Max_Line_Length;
+ Saved_ML : constant Int := Style_Max_Line_Length;
+ Saved_CML : constant Boolean := Style_Check_Max_Line_Length;
List : Elist_Id;
@@ -1395,7 +1396,7 @@ package body Sem is
Restore_Scope_Stack (List);
Restore_Ghost_Region (Saved_GM, Saved_IGR);
Style_Max_Line_Length := Saved_ML;
- Style_Check_Max_Line_Length := Style_Max_Line_Length /= 0;
+ Style_Check_Max_Line_Length := Saved_CML;
end Do_Analyze;
-- Local variables