]> gcc.gnu.org Git - gcc.git/commitdiff
[multiple changes]
authorPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Tue, 5 Dec 2017 12:22:46 +0000 (12:22 +0000)
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>
Tue, 5 Dec 2017 12:22:46 +0000 (12:22 +0000)
2017-12-05  Hristian Kirtchev  <kirtchev@adacore.com>

* sem_elab.adb: Update the terminology and switch sections.
(Check_SPARK_Model_In_Effect): New routine.
(Check_SPARK_Scenario): Verify the model in effect for SPARK.
(Process_Conditional_ABE_Call_SPARK): Verify the model in effect for
SPARK.
(Process_Conditional_ABE_Instantiation_SPARK): Verify the model in
effect for SPARK.
(Process_Conditional_ABE_Variable_Assignment_SPARK): Verify the model
in effect for SPARK.

2017-12-05  Nicolas Setton  <setton@adacore.com>

* terminals.c (__gnat_setup_child_communication): As documented,
__gnat_setup_child_communication should not terminate - it is intended
to be used as the child process of a call to fork().  However, execvp
might actually return in some cases, for instance when attempting to
run a 32-bit binary on a 64-bit Linux distribution when the
compatibility packages are not installed. In these cases, exit the
program to conform to the documentation.

2017-12-05  Olivier Hainque  <hainque@adacore.com>

* libgnat/s-tsmona.adb: Fix for oversight in the tsmona interface
update.

2017-12-05  Gary Dismukes  <dismukes@adacore.com>

* doc/gnat_ugn/elaboration_order_handling_in_gnat.rst: Minor typo fix
and reformatting.
* gnat_ugn.texi: Regenerate.

2017-12-05  Olivier Hainque  <hainque@adacore.com>

* sem_util.adb (Set_Convention): Always clear Can_Use_Internal_Rep
on access to subprogram types with foreign convention.

2017-12-05  Yannick Moy  <moy@adacore.com>

* doc/gnat_ugn/building_executable_programs_with_gnat.rst: Fix User's
Guide description of default settings of warnings.

From-SVN: r255413

gcc/ada/ChangeLog
gcc/ada/doc/gnat_ugn/building_executable_programs_with_gnat.rst
gcc/ada/doc/gnat_ugn/elaboration_order_handling_in_gnat.rst
gcc/ada/gnat_ugn.texi
gcc/ada/libgnat/s-tsmona.adb
gcc/ada/sem_elab.adb
gcc/ada/sem_util.adb
gcc/ada/terminals.c

index 3507a1fa3c270ca6cadb39dc996c8872a978d19f..653d1e9fdc160e43a38eecffcdc3365cd73aee78 100644 (file)
@@ -1,3 +1,46 @@
+2017-12-05  Hristian Kirtchev  <kirtchev@adacore.com>
+
+       * sem_elab.adb: Update the terminology and switch sections.
+       (Check_SPARK_Model_In_Effect): New routine.
+       (Check_SPARK_Scenario): Verify the model in effect for SPARK.
+       (Process_Conditional_ABE_Call_SPARK): Verify the model in effect for
+       SPARK.
+       (Process_Conditional_ABE_Instantiation_SPARK): Verify the model in
+       effect for SPARK.
+       (Process_Conditional_ABE_Variable_Assignment_SPARK): Verify the model
+       in effect for SPARK.
+
+2017-12-05  Nicolas Setton  <setton@adacore.com>
+
+       * terminals.c (__gnat_setup_child_communication): As documented,
+       __gnat_setup_child_communication should not terminate - it is intended
+       to be used as the child process of a call to fork().  However, execvp
+       might actually return in some cases, for instance when attempting to
+       run a 32-bit binary on a 64-bit Linux distribution when the
+       compatibility packages are not installed. In these cases, exit the
+       program to conform to the documentation.
+
+2017-12-05  Olivier Hainque  <hainque@adacore.com>
+
+       * libgnat/s-tsmona.adb: Fix for oversight in the tsmona interface
+       update.
+
+2017-12-05  Gary Dismukes  <dismukes@adacore.com>
+
+       * doc/gnat_ugn/elaboration_order_handling_in_gnat.rst: Minor typo fix
+       and reformatting.
+       * gnat_ugn.texi: Regenerate.
+
+2017-12-05  Olivier Hainque  <hainque@adacore.com>
+
+       * sem_util.adb (Set_Convention): Always clear Can_Use_Internal_Rep
+       on access to subprogram types with foreign convention.
+
+2017-12-05  Yannick Moy  <moy@adacore.com>
+
+       * doc/gnat_ugn/building_executable_programs_with_gnat.rst: Fix User's
+       Guide description of default settings of warnings.
+
 2017-12-05  Olivier Hainque  <hainque@adacore.com>
 
        * s-dwalin.adb (Read_And_Execute_Isn): Adjust test checking for the end
index b6447d05dd67b20a0d5f3d2befc0a105f739b6dd..802e905e8f2c6a49b478fe665b85d56a8ba89d55 100644 (file)
@@ -4075,20 +4075,28 @@ When no switch :switch:`-gnatw` is used, this is equivalent to:
 
   * :switch:`-gnatwD`
 
+  * :switch:`-gnatw.D`
+
   * :switch:`-gnatwF`
 
+  * :switch:`-gnatw.F`
+
   * :switch:`-gnatwg`
 
   * :switch:`-gnatwH`
 
-  * :switch:`-gnatwi`
+  * :switch:`-gnatw.H`
 
-  * :switch:`-gnatw.I`
+  * :switch:`-gnatwi`
 
   * :switch:`-gnatwJ`
 
+  * :switch:`-gnatw.J`
+
   * :switch:`-gnatwK`
 
+  * :switch:`-gnatw.K`
+
   * :switch:`-gnatwL`
 
   * :switch:`-gnatw.L`
@@ -4099,6 +4107,8 @@ When no switch :switch:`-gnatw` is used, this is equivalent to:
 
   * :switch:`-gnatwn`
 
+  * :switch:`-gnatw.N`
+
   * :switch:`-gnatwo`
 
   * :switch:`-gnatw.O`
@@ -4119,12 +4129,16 @@ When no switch :switch:`-gnatw` is used, this is equivalent to:
 
   * :switch:`-gnatwT`
 
-  * :switch:`-gnatw.T`
+  * :switch:`-gnatw.t`
 
   * :switch:`-gnatwU`
 
+  * :switch:`-gnatw.U`
+
   * :switch:`-gnatwv`
 
+  * :switch:`-gnatw.v`
+
   * :switch:`-gnatww`
 
   * :switch:`-gnatw.W`
@@ -4135,8 +4149,12 @@ When no switch :switch:`-gnatw` is used, this is equivalent to:
 
   * :switch:`-gnatwy`
 
+  * :switch:`-gnatw.Y`
+
   * :switch:`-gnatwz`
 
+  * :switch:`-gnatw.z`
+
 .. _Debugging_and_Assertion_Control:
 
 Debugging and Assertion Control
index d29a915f417699bbf88d4d104d79e70d35bf388a..a4b8b7fed477ccde06f215d4dd9f2d277280d129 100644 (file)
@@ -634,7 +634,7 @@ elaboration order and to diagnose elaboration problems.
 
 * *Legacy elaboration model*
 
-  In addition to the three elabortaion models outlined above, GNAT provides the
+  In addition to the three elaboration models outlined above, GNAT provides the
   elaboration model of pre-18.x versions referred to as `legacy elaboration
   model`. The legacy elaboration model is enabled with compiler switch
   :switch:`-gnatH`.
@@ -1515,7 +1515,7 @@ the elaboration order chosen by the binder.
 :switch:`-gnatJ`
   Relaxed elaboration checking mode enabled
 
-  When this switch is in effect, GNAT will not process certain scenarios
+  When this switch is in effect, GNAT will not process certain scenarios,
   resulting in a more permissive elaboration model. Note that this may
   eliminate some diagnostics and run-time checks.
 
index cc902b3e7e59a6bc8c6e422d73803f4eee251d16..798743073dd2448761074142a0bfd2860d9ef2c7 100644 (file)
@@ -12728,9 +12728,15 @@ When no switch @code{-gnatw} is used, this is equivalent to:
 @item 
 @code{-gnatwD}
 
+@item 
+@code{-gnatw.D}
+
 @item 
 @code{-gnatwF}
 
+@item 
+@code{-gnatw.F}
+
 @item 
 @code{-gnatwg}
 
@@ -12738,17 +12744,23 @@ When no switch @code{-gnatw} is used, this is equivalent to:
 @code{-gnatwH}
 
 @item 
-@code{-gnatwi}
+@code{-gnatw.H}
 
 @item 
-@code{-gnatw.I}
+@code{-gnatwi}
 
 @item 
 @code{-gnatwJ}
 
+@item 
+@code{-gnatw.J}
+
 @item 
 @code{-gnatwK}
 
+@item 
+@code{-gnatw.K}
+
 @item 
 @code{-gnatwL}
 
@@ -12764,6 +12776,9 @@ When no switch @code{-gnatw} is used, this is equivalent to:
 @item 
 @code{-gnatwn}
 
+@item 
+@code{-gnatw.N}
+
 @item 
 @code{-gnatwo}
 
@@ -12795,14 +12810,20 @@ When no switch @code{-gnatw} is used, this is equivalent to:
 @code{-gnatwT}
 
 @item 
-@code{-gnatw.T}
+@code{-gnatw.t}
 
 @item 
 @code{-gnatwU}
 
+@item 
+@code{-gnatw.U}
+
 @item 
 @code{-gnatwv}
 
+@item 
+@code{-gnatw.v}
+
 @item 
 @code{-gnatww}
 
@@ -12818,8 +12839,14 @@ When no switch @code{-gnatw} is used, this is equivalent to:
 @item 
 @code{-gnatwy}
 
+@item 
+@code{-gnatw.Y}
+
 @item 
 @code{-gnatwz}
+
+@item 
+@code{-gnatw.z}
 @end itemize
 @end quotation
 
@@ -27841,7 +27868,7 @@ effect.
 @item 
 @emph{Legacy elaboration model}
 
-In addition to the three elabortaion models outlined above, GNAT provides the
+In addition to the three elaboration models outlined above, GNAT provides the
 elaboration model of pre-18.x versions referred to as @cite{legacy elaboration model}. The legacy elaboration model is enabled with compiler switch
 @code{-gnatH}.
 @end itemize
@@ -28811,7 +28838,7 @@ model.
 
 Relaxed elaboration checking mode enabled
 
-When this switch is in effect, GNAT will not process certain scenarios
+When this switch is in effect, GNAT will not process certain scenarios,
 resulting in a more permissive elaboration model. Note that this may
 eliminate some diagnostics and run-time checks.
 @end table
index 95edb6b7e13860c8c5451faf0b4e45ae94e6a375..e04652d49076456040628fa265f307ccd04bef6b 100644 (file)
@@ -48,8 +48,12 @@ package body Module_Name is
    -- Get --
    ---------
 
-   function Get (Addr : access System.Address) return String is
+   function Get (Addr : System.Address;
+                 Load_Addr : access System.Address)
+      return String
+   is
       pragma Unreferenced (Addr);
+      pragma Unreferenced (Load_Addr);
 
    begin
       return "";
index 99f2dd11f700419f320895e358e96aef040a36a4..b2e56e62bd8d792dad0417b445183721ea0493a2 100644 (file)
@@ -117,6 +117,9 @@ package body Sem_Elab is
    -- Terminology --
    -----------------
 
+   --  * ABE - An attempt to activate, call, or instantiate a scenario which
+   --    has not been fully elaborated.
+   --
    --  * Bridge target - A type of target. A bridge target is a link between
    --    scenarios. It is usually a byproduct of expansion and does not have
    --    any direct ABE ramifications.
@@ -421,6 +424,8 @@ package body Sem_Elab is
    --           calls to subprograms which verify the run-time semantics of
    --           the following assertion pragmas:
    --
+   --              Default_Initial_Condition
+   --              Initial_Condition
    --              Invariant
    --              Invariant'Class
    --              Post
@@ -429,8 +434,8 @@ package body Sem_Elab is
    --              Type_Invariant
    --              Type_Invariant_Class
    --
-   --           As a result, the assertion expressions of the pragmas will not
-   --           be processed.
+   --           As a result, the assertion expressions of the pragmas are not
+   --           processed.
    --
    --  -gnatd.U ignore indirect calls for static elaboration
    --
@@ -1044,6 +1049,12 @@ package body Sem_Elab is
    --  Verify that expanded instance Exp_Inst does not precede the generic body
    --  it instantiates (SPARK RM 7.7(6)).
 
+   procedure Check_SPARK_Model_In_Effect (N : Node_Id);
+   pragma Inline (Check_SPARK_Model_In_Effect);
+   --  Determine whether a suitable elaboration model is currently in effect
+   --  for verifying the SPARK rules of scenario N. Emit a warning if this is
+   --  not the case.
+
    procedure Check_SPARK_Scenario (N : Node_Id);
    pragma Inline (Check_SPARK_Scenario);
    --  Top-level dispatcher for verifying SPARK scenarios which are not always
@@ -2696,12 +2707,57 @@ package body Sem_Elab is
       end if;
    end Check_SPARK_Instantiation;
 
+   ---------------------------------
+   -- Check_SPARK_Model_In_Effect --
+   ---------------------------------
+
+   SPARK_Model_Warning_Posted : Boolean := False;
+   --  This flag prevents the same SPARK model-related warning from being
+   --  emitted multiple times.
+
+   procedure Check_SPARK_Model_In_Effect (N : Node_Id) is
+   begin
+      --  Do not emit the warning multiple times as this creates useless noise
+
+      if SPARK_Model_Warning_Posted then
+         null;
+
+      --  SPARK rule verification requires the "strict" static model
+
+      elsif Static_Elaboration_Checks and not Relaxed_Elaboration_Checks then
+         null;
+
+      --  Any other combination of models does not guarantee the absence of ABE
+      --  problems for SPARK rule verification purposes. Note that there is no
+      --  need to check for the legacy ABE mechanism because the legacy code
+      --  has its own orthogonal processing for SPARK rules.
+
+      else
+         SPARK_Model_Warning_Posted := True;
+
+         Error_Msg_N
+           ("??SPARK elaboration checks require static elaboration model", N);
+
+         if Dynamic_Elaboration_Checks then
+            Error_Msg_N ("\dynamic elaboration model is in effect", N);
+         else
+            pragma Assert (Relaxed_Elaboration_Checks);
+            Error_Msg_N ("\relaxed elaboration model is in effect", N);
+         end if;
+      end if;
+   end Check_SPARK_Model_In_Effect;
+
    --------------------------
    -- Check_SPARK_Scenario --
    --------------------------
 
    procedure Check_SPARK_Scenario (N : Node_Id) is
    begin
+      --  Ensure that a suitable elaboration model is in effect for SPARK rule
+      --  verification.
+
+      Check_SPARK_Model_In_Effect (N);
+
       --  Add the current scenario to the stack of active scenarios
 
       Push_Active_Scenario (N);
@@ -9211,6 +9267,11 @@ package body Sem_Elab is
       Region : Node_Id;
 
    begin
+      --  Ensure that a suitable elaboration model is in effect for SPARK rule
+      --  verification.
+
+      Check_SPARK_Model_In_Effect (Call);
+
       --  The call and the target body are both in the main unit
 
       if Present (Target_Attrs.Body_Decl)
@@ -9674,6 +9735,11 @@ package body Sem_Elab is
       Req_Nam : Name_Id;
 
    begin
+      --  Ensure that a suitable elaboration model is in effect for SPARK rule
+      --  verification.
+
+      Check_SPARK_Model_In_Effect (Inst);
+
       --  A source instantiation imposes an Elaborate[_All] requirement on the
       --  context of the main unit. Determine whether the context has a pragma
       --  strong enough to meet the requirement. The check is orthogonal to the
@@ -9807,6 +9873,11 @@ package body Sem_Elab is
       Spec_Id  : constant Entity_Id := Find_Top_Unit (Var_Decl);
 
    begin
+      --  Ensure that a suitable elaboration model is in effect for SPARK rule
+      --  verification.
+
+      Check_SPARK_Model_In_Effect (Asmt);
+
       --  Emit an error when an initialized variable declared in a package spec
       --  without pragma Elaborate_Body is further modified by elaboration code
       --  within the corresponding body.
index 3209df418da63fe414e9ebf7bd538fbbf0eb1d2a..43e9ea2b09241b1058f163b21fcd3f74d70b0e39 100644 (file)
@@ -23090,17 +23090,7 @@ package body Sem_Util is
         and then Is_Access_Subprogram_Type (Base_Type (E))
         and then Has_Foreign_Convention (E)
       then
-
-         --  A pragma Convention in an instance may apply to the subtype
-         --  created for a formal, in which case we have already verified
-         --  that conventions of actual and formal match and there is nothing
-         --  to flag on the subtype.
-
-         if In_Instance then
-            null;
-         else
-            Set_Can_Use_Internal_Rep (E, False);
-         end if;
+         Set_Can_Use_Internal_Rep (E, False);
       end if;
 
       --  If E is an object, including a component, and the type of E is an
index 9f300514ced8d50c2e6388a1a3ef72f583ca1602..1e295afe055900741708b9191f90e5608fd3afdb 100644 (file)
@@ -1458,7 +1458,7 @@ __gnat_setup_child_communication
 #ifdef TIOCSCTTY
   /* make the tty the controlling terminal */
   if ((status = ioctl (desc->slave_fd, TIOCSCTTY, 0)) == -1)
-    return -1;
+    _exit (1);
 #endif
 
   /* adjust tty settings */
@@ -1480,8 +1480,7 @@ __gnat_setup_child_communication
   /* launch the program */
   execvp (new_argv[0], new_argv);
 
-  /* return the pid */
-  return pid;
+  _exit (1);
 }
 
 /* send_signal_via_characters - Send a characters that will trigger a signal
This page took 0.112007 seconds and 5 git commands to generate.