-- Tolerate time stamp and other consistency errors. If this flag is set to
-- True (-t), then inconsistencies result in warnings rather than errors.
+ Treat_Restrictions_As_Warnings : Boolean := False;
+ -- GNAT
+ -- Set True to treat pragma Restrictions as Restriction_Warnings. Set by
+ -- -gnatr switch.
+
Tree_Output : Boolean := False;
-- GNAT
-- Set to True (-gnatt) to generate output tree file
elsif Id = Name_No_Dependence then
Set_Restriction_No_Dependence
(Unit => Expr,
- Warn => Prag_Id = Pragma_Restriction_Warnings);
+ Warn => Prag_Id = Pragma_Restriction_Warnings
+ or else Treat_Restrictions_As_Warnings);
end if;
Next (Arg);
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
(P : Profile_Name;
N : Node_Id;
Warn : Boolean);
- -- Sets the set of restrictions associated with the given profile
- -- name. N is the node of the construct to which error messages
- -- are to be attached as required. Warn is set True for the case
- -- of Profile_Warnings where the restrictions are set as warnings
- -- rather than legality requirements.
+ -- Sets the set of restrictions associated with the given profile name. N
+ -- is the node of the construct to which error messages are to be attached
+ -- as required. Warn is set True for the case of Profile_Warnings where the
+ -- restrictions are set as warnings rather than legality requirements, and
+ -- is also True for Profile if the Treat_Restrictions_As_Warnings flag is
+ -- set. It is false for Profile if this flag is not set.
procedure Set_Restriction
(R : All_Boolean_Restrictions;
(Unit : Node_Id;
Warn : Boolean);
-- Sets given No_Dependence restriction in table if not there already.
- -- Warn is True if from Restriction_Warnings, False if from Restrictions.
+ -- Warn is True if from Restriction_Warnings, or for Restrictions if flag
+ -- Treat_Restrictions_As_Warnings is set. False if from Restrictions and
+ -- this flag is not set.
function Tasking_Allowed return Boolean;
pragma Inline (Tasking_Allowed);
procedure Process_Restrictions_Or_Restriction_Warnings (Warn : Boolean);
-- Common processing for Restrictions and Restriction_Warnings pragmas.
- -- Warn is False for Restrictions, True for Restriction_Warnings.
+ -- Warn is True for Restriction_Warnings, or for Restrictions if the
+ -- flag Treat_Restrictions_As_Warnings is set, and False if this flag
+ -- is not set in the Restrictions case.
procedure Process_Suppress_Unsuppress (Suppress_Case : Boolean);
-- Common processing for Suppress and Unsuppress. The boolean parameter
-- Set the corresponding restrictions
- Set_Profile_Restrictions (Ravenscar, N, Warn => False);
+ Set_Profile_Restrictions
+ (Ravenscar, N, Warn => Treat_Restrictions_As_Warnings);
end Set_Ravenscar_Profile;
-- Start of processing for Analyze_Pragma
if Chars (Argx) = Name_Ravenscar then
Set_Ravenscar_Profile (N);
elsif Chars (Argx) = Name_Restricted then
- Set_Profile_Restrictions (Restricted, N, Warn => False);
+ Set_Profile_Restrictions
+ (Restricted, N, Warn => Treat_Restrictions_As_Warnings);
else
Error_Pragma_Arg ("& is not a valid profile", Argx);
end if;
GNAT_Pragma;
Check_Arg_Count (0);
Check_Valid_Configuration_Pragma;
- Set_Profile_Restrictions (Restricted, N, Warn => False);
+ Set_Profile_Restrictions
+ (Restricted, N, Warn => Treat_Restrictions_As_Warnings);
if Warn_On_Obsolescent_Feature then
Error_Msg_N
-- | restriction_parameter_IDENTIFIER => EXPRESSION
when Pragma_Restrictions =>
- Process_Restrictions_Or_Restriction_Warnings (Warn => False);
+ Process_Restrictions_Or_Restriction_Warnings
+ (Warn => Treat_Restrictions_As_Warnings);
--------------------------
-- Restriction_Warnings --
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2007, Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2008, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
Ptr := Ptr + 1;
Try_Semantics := True;
- -- Processing for q switch
+ -- Processing for Q switch
when 'Q' =>
Ptr := Ptr + 1;
Force_ALI_Tree_File := True;
Try_Semantics := True;
+ -- Processing for r switch
+
+ when 'r' =>
+ Ptr := Ptr + 1;
+ Treat_Restrictions_As_Warnings := True;
+
-- Processing for R switch
when 'R' =>
Write_Switch_Char ("Q");
Write_Line ("Don't quit, write ali/tree file even if compile errors");
+ -- Line for -gnatr switch
+
+ Write_Switch_Char ("r");
+ Write_Line ("Treat pragma Restrictions as Restriction_Warnings");
+
-- Lines for -gnatR switch
Write_Switch_Char ("R?");