1 ------------------------------------------------------------------------------
3 -- GNAT COMPILER COMPONENTS --
9 -- Copyright (C) 1992-2022, Free Software Foundation, Inc. --
11 -- GNAT is free software; you can redistribute it and/or modify it under --
12 -- terms of the GNU General Public License as published by the Free Soft- --
13 -- ware Foundation; either version 3, or (at your option) any later ver- --
14 -- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
15 -- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
16 -- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
17 -- for more details. You should have received a copy of the GNU General --
18 -- Public License distributed with GNAT; see file COPYING3. If not, go to --
19 -- http://www.gnu.org/licenses for a complete copy of the license. --
21 -- GNAT was originally developed by the GNAT team at New York University. --
22 -- Extensive contributions were provided by Ada Core Technologies Inc. --
24 ------------------------------------------------------------------------------
26 with Atree
; use Atree
;
27 with Casing
; use Casing
;
28 with Einfo
; use Einfo
;
29 with Einfo
.Entities
; use Einfo
.Entities
;
30 with Einfo
.Utils
; use Einfo
.Utils
;
31 with Errout
; use Errout
;
32 with Debug
; use Debug
;
33 with Fname
; use Fname
;
34 with Fname
.UF
; use Fname
.UF
;
37 with Sinfo
; use Sinfo
;
38 with Sinfo
.Nodes
; use Sinfo
.Nodes
;
39 with Sinfo
.Utils
; use Sinfo
.Utils
;
40 with Sinput
; use Sinput
;
41 with Stand
; use Stand
;
42 with Targparm
; use Targparm
;
43 with Uname
; use Uname
;
45 package body Restrict
is
47 Global_Restriction_No_Tasking
: Boolean := False;
48 -- Set to True when No_Tasking is set in the run-time package System
49 -- or in a configuration pragmas file (for example, gnat.adc).
51 --------------------------------
52 -- Package Local Declarations --
53 --------------------------------
55 Config_Cunit_Boolean_Restrictions
: Save_Cunit_Boolean_Restrictions
;
56 -- Save compilation unit restrictions set by config pragma files
58 Restricted_Profile_Result
: Boolean := False;
59 -- This switch memoizes the result of Restricted_Profile function calls for
60 -- improved efficiency. Valid only if Restricted_Profile_Cached is True.
61 -- Note: if this switch is ever set True, it is never turned off again.
63 Restricted_Profile_Cached
: Boolean := False;
64 -- This flag is set to True if the Restricted_Profile_Result contains the
65 -- correct cached result of Restricted_Profile calls.
67 No_Specification_Of_Aspects
: array (Aspect_Id
) of Source_Ptr
:=
68 (others => No_Location
);
69 -- Entries in this array are set to point to a previously occurring pragma
70 -- that activates a No_Specification_Of_Aspect check.
72 No_Specification_Of_Aspect_Warning
: array (Aspect_Id
) of Boolean :=
74 -- An entry in this array is set False in response to a previous call to
75 -- Set_No_Specification_Of_Aspect for pragmas in the main unit that
76 -- specify Warning as False. Once set False, an entry is never reset.
78 No_Specification_Of_Aspect_Set
: Boolean := False;
79 -- Set True if any entry of No_Specification_Of_Aspects has been set True.
80 -- Once set True, this is never turned off again.
82 No_Use_Of_Attribute
: array (Attribute_Id
) of Source_Ptr
:=
83 (others => No_Location
);
85 No_Use_Of_Attribute_Warning
: array (Attribute_Id
) of Boolean :=
88 No_Use_Of_Attribute_Set
: Boolean := False;
89 -- Indicates that No_Use_Of_Attribute was set at least once
91 No_Use_Of_Pragma
: array (Pragma_Id
) of Source_Ptr
:=
92 (others => No_Location
);
93 -- Source location of pragma No_Use_Of_Pragma for given pragma, a value
94 -- of System_Location indicates occurrence in system.ads.
96 No_Use_Of_Pragma_Warning
: array (Pragma_Id
) of Boolean :=
99 No_Use_Of_Pragma_Set
: Boolean := False;
100 -- Indicates that No_Use_Of_Pragma was set at least once
102 -----------------------
103 -- Local Subprograms --
104 -----------------------
106 procedure Restriction_Msg
(R
: Restriction_Id
; N
: Node_Id
);
107 -- Called if a violation of restriction R at node N is found. This routine
108 -- outputs the appropriate message or messages taking care of warning vs
109 -- real violation, serious vs non-serious, implicit vs explicit, the second
110 -- message giving the profile name if needed, and the location information.
112 function Same_Entity
(E1
, E2
: Node_Id
) return Boolean;
113 -- Returns True iff E1 and E2 represent the same entity. Used for handling
114 -- of No_Use_Of_Entity => fully_qualified_ENTITY restriction case.
116 function Same_Unit
(U1
, U2
: Node_Id
) return Boolean;
117 -- Returns True iff U1 and U2 represent the same library unit. Used for
118 -- handling of No_Dependence => Unit restriction case.
120 function Suppress_Restriction_Message
(N
: Node_Id
) return Boolean;
121 -- N is the node for a possible restriction violation message, but the
122 -- message is to be suppressed if this is an internal file and this file is
123 -- not the main unit. Returns True if message is to be suppressed.
129 function Abort_Allowed
return Boolean is
131 if Restrictions
.Set
(No_Abort_Statements
)
132 and then Restrictions
.Set
(Max_Asynchronous_Select_Nesting
)
133 and then Restrictions
.Value
(Max_Asynchronous_Select_Nesting
) = 0
141 ----------------------------------------
142 -- Add_To_Config_Boolean_Restrictions --
143 ----------------------------------------
145 procedure Add_To_Config_Boolean_Restrictions
(R
: Restriction_Id
) is
147 Config_Cunit_Boolean_Restrictions
(R
) := True;
148 end Add_To_Config_Boolean_Restrictions
;
149 -- Add specified restriction to stored configuration boolean restrictions.
150 -- This is used for handling the special case of No_Elaboration_Code.
152 ------------------------------------
153 -- Check_Elaboration_Code_Allowed --
154 ------------------------------------
156 procedure Check_Elaboration_Code_Allowed
(N
: Node_Id
) is
158 Check_Restriction
(No_Elaboration_Code
, N
);
159 end Check_Elaboration_Code_Allowed
;
161 -----------------------------------------
162 -- Check_Implicit_Dynamic_Code_Allowed --
163 -----------------------------------------
165 procedure Check_Implicit_Dynamic_Code_Allowed
(N
: Node_Id
) is
167 Check_Restriction
(No_Implicit_Dynamic_Code
, N
);
168 end Check_Implicit_Dynamic_Code_Allowed
;
170 --------------------------------
171 -- Check_No_Implicit_Aliasing --
172 --------------------------------
174 procedure Check_No_Implicit_Aliasing
(Obj
: Node_Id
) is
178 -- If restriction not active, nothing to check
180 if not Restriction_Active
(No_Implicit_Aliasing
) then
184 -- If we have an entity name, check entity
186 if Is_Entity_Name
(Obj
) then
189 -- Restriction applies to entities that are objects
191 if Is_Object
(E
) then
192 if Is_Aliased
(E
) then
195 elsif Present
(Renamed_Object
(E
)) then
196 Check_No_Implicit_Aliasing
(Renamed_Object
(E
));
200 -- If we don't have an object, then it's OK
206 -- For selected component, check selector
208 elsif Nkind
(Obj
) = N_Selected_Component
then
209 Check_No_Implicit_Aliasing
(Selector_Name
(Obj
));
212 -- Indexed component is OK if aliased components
214 elsif Nkind
(Obj
) = N_Indexed_Component
then
215 if Has_Aliased_Components
(Etype
(Prefix
(Obj
)))
217 (Is_Access_Type
(Etype
(Prefix
(Obj
)))
218 and then Has_Aliased_Components
219 (Designated_Type
(Etype
(Prefix
(Obj
)))))
224 -- For type conversion, check converted expression
226 elsif Nkind
(Obj
) in N_Unchecked_Type_Conversion | N_Type_Conversion
then
227 Check_No_Implicit_Aliasing
(Expression
(Obj
));
230 -- Explicit dereference is always OK
232 elsif Nkind
(Obj
) = N_Explicit_Dereference
then
236 -- If we fall through, then we have an aliased view that does not meet
237 -- the rules for being explicitly aliased, so issue restriction msg.
239 Check_Restriction
(No_Implicit_Aliasing
, Obj
);
240 end Check_No_Implicit_Aliasing
;
242 ----------------------------------
243 -- Check_No_Implicit_Heap_Alloc --
244 ----------------------------------
246 procedure Check_No_Implicit_Heap_Alloc
(N
: Node_Id
) is
248 Check_Restriction
(No_Implicit_Heap_Allocations
, N
);
249 end Check_No_Implicit_Heap_Alloc
;
251 ----------------------------------
252 -- Check_No_Implicit_Task_Alloc --
253 ----------------------------------
255 procedure Check_No_Implicit_Task_Alloc
(N
: Node_Id
) is
257 Check_Restriction
(No_Implicit_Task_Allocations
, N
);
258 end Check_No_Implicit_Task_Alloc
;
260 ---------------------------------------
261 -- Check_No_Implicit_Protected_Alloc --
262 ---------------------------------------
264 procedure Check_No_Implicit_Protected_Alloc
(N
: Node_Id
) is
266 Check_Restriction
(No_Implicit_Protected_Object_Allocations
, N
);
267 end Check_No_Implicit_Protected_Alloc
;
269 -----------------------------------
270 -- Check_Obsolescent_2005_Entity --
271 -----------------------------------
273 procedure Check_Obsolescent_2005_Entity
(E
: Entity_Id
; N
: Node_Id
) is
274 function Chars_Is
(E
: Entity_Id
; S
: String) return Boolean;
275 -- Return True iff Chars (E) matches S (given in lower case)
281 function Chars_Is
(E
: Entity_Id
; S
: String) return Boolean is
282 Nam
: constant Name_Id
:= Chars
(E
);
284 if Length_Of_Name
(Nam
) /= S
'Length then
287 return Get_Name_String
(Nam
) = S
;
291 -- Start of processing for Check_Obsolescent_2005_Entity
294 if Restriction_Check_Required
(No_Obsolescent_Features
)
295 and then Ada_Version
>= Ada_2005
296 and then Chars_Is
(Scope
(E
), "handling")
297 and then Chars_Is
(Scope
(Scope
(E
)), "characters")
298 and then Chars_Is
(Scope
(Scope
(Scope
(E
))), "ada")
299 and then Scope
(Scope
(Scope
(Scope
(E
)))) = Standard_Standard
301 if Chars_Is
(E
, "is_character") or else
302 Chars_Is
(E
, "is_string") or else
303 Chars_Is
(E
, "to_character") or else
304 Chars_Is
(E
, "to_string") or else
305 Chars_Is
(E
, "to_wide_character") or else
306 Chars_Is
(E
, "to_wide_string")
308 Check_Restriction
(No_Obsolescent_Features
, N
);
311 end Check_Obsolescent_2005_Entity
;
313 ---------------------------
314 -- Check_Restricted_Unit --
315 ---------------------------
317 procedure Check_Restricted_Unit
(U
: Unit_Name_Type
; N
: Node_Id
) is
319 if Suppress_Restriction_Message
(N
) then
322 elsif Is_Spec_Name
(U
) then
324 Fnam
: constant File_Name_Type
:=
325 Get_File_Name
(U
, Subunit
=> False);
330 Get_Name_String
(Fnam
);
332 -- Nothing to do if name not at least 5 characters long ending
333 -- in .ads or .adb extension, which we strip.
336 or else (Name_Buffer
(Name_Len
- 3 .. Name_Len
) /= ".ads"
338 Name_Buffer
(Name_Len
- 3 .. Name_Len
) /= ".adb")
343 -- Strip extension and pad to eight characters
345 Name_Len
:= Name_Len
- 4;
346 Add_Str_To_Name_Buffer
((Name_Len
+ 1 .. 8 => ' '));
348 -- If predefined unit, check the list of restricted units
350 if Is_Predefined_File_Name
(Fnam
) then
351 for J
in Unit_Array
'Range loop
353 and then Name_Buffer
(1 .. 8) = Unit_Array
(J
).Filenm
355 Check_Restriction
(Unit_Array
(J
).Res_Id
, N
);
359 -- If not predefined unit, then one special check still
360 -- remains. GNAT.Current_Exception is not allowed if we have
361 -- restriction No_Exception_Propagation active.
364 if Name_Buffer
(1 .. 8) = "g-curexc" then
365 Check_Restriction
(No_Exception_Propagation
, N
);
370 end Check_Restricted_Unit
;
372 -----------------------
373 -- Check_Restriction --
374 -----------------------
376 procedure Check_Restriction
379 V
: Uint
:= Uint_Minus_1
)
381 Ignore_Msg_Issued
: Boolean;
383 Check_Restriction
(Ignore_Msg_Issued
, R
, N
, V
);
384 end Check_Restriction
;
386 procedure Check_Restriction
387 (Msg_Issued
: out Boolean;
390 V
: Uint
:= Uint_Minus_1
)
393 -- V converted to integer form. If V is greater than Integer'Last,
394 -- it is reset to minus 1 (unknown value).
396 procedure Update_Restrictions
(Info
: in out Restrictions_Info
);
397 -- Update violation information in Info.Violated and Info.Count
399 -------------------------
400 -- Update_Restrictions --
401 -------------------------
403 procedure Update_Restrictions
(Info
: in out Restrictions_Info
) is
405 -- If not violated, set as violated now
407 if not Info
.Violated
(R
) then
408 Info
.Violated
(R
) := True;
410 if R
in All_Parameter_Restrictions
then
412 Info
.Unknown
(R
) := True;
416 Info
.Count
(R
) := VV
;
420 -- Otherwise if violated already and a parameter restriction,
421 -- update count by maximizing or summing depending on restriction.
423 elsif R
in All_Parameter_Restrictions
then
425 -- If new value is unknown, result is unknown
428 Info
.Unknown
(R
) := True;
430 -- If checked by maximization, nothing to do because the
431 -- check is per-object.
433 elsif R
in Checked_Max_Parameter_Restrictions
then
436 -- If checked by adding, do add, checking for overflow
438 elsif R
in Checked_Add_Parameter_Restrictions
then
440 pragma Unsuppress
(Overflow_Check
);
442 Info
.Count
(R
) := Info
.Count
(R
) + VV
;
444 when Constraint_Error
=>
445 Info
.Count
(R
) := Integer'Last;
446 Info
.Unknown
(R
) := True;
449 -- Should not be able to come here, known counts should only
450 -- occur for restrictions that are Checked_max or Checked_Sum.
456 end Update_Restrictions
;
458 -- Start of processing for Check_Restriction
463 -- In CodePeer mode, we do not want to check for any restriction, or set
464 -- additional restrictions other than those already set in gnat1drv.adb
465 -- so that we have consistency between each compilation.
467 -- In GNATprove mode restrictions are checked, except for
468 -- No_Initialize_Scalars, which is implicitly set in gnat1drv.adb.
471 or else (GNATprove_Mode
and then R
= No_Initialize_Scalars
)
476 if UI_Is_In_Int_Range
(V
) then
477 VV
:= Integer (UI_To_Int
(V
));
482 -- Count can only be specified in the checked val parameter case
484 pragma Assert
(VV
< 0 or else R
in Checked_Val_Parameter_Restrictions
);
486 -- Nothing to do if value of zero specified for parameter restriction
492 -- Update current restrictions
494 Update_Restrictions
(Restrictions
);
496 -- If in main extended unit, update main restrictions as well. Note
497 -- that as usual we check for Main_Unit explicitly to deal with the
498 -- case of configuration pragma files.
500 if Current_Sem_Unit
= Main_Unit
501 or else In_Extended_Main_Source_Unit
(N
)
503 Update_Restrictions
(Main_Restrictions
);
506 -- Nothing to do if restriction message suppressed
508 if Suppress_Restriction_Message
(N
) then
511 -- If restriction not set, nothing to do
513 elsif not Restrictions
.Set
(R
) then
516 -- Don't complain about No_Obsolescent_Features in an instance, since we
517 -- will complain on the template, which is much better. Are there other
518 -- cases like this ??? Do we need a more general mechanism ???
520 elsif R
= No_Obsolescent_Features
521 and then Instantiation_Location
(Sloc
(N
)) /= No_Location
525 -- Here if restriction set, check for violation (this is a Boolean
526 -- restriction, or a parameter restriction with a value of zero and an
527 -- unknown count, or a parameter restriction with a known value that
528 -- exceeds the restriction count).
530 elsif R
in All_Boolean_Restrictions
531 or else (Restrictions
.Unknown
(R
)
532 and then Restrictions
.Value
(R
) = 0)
533 or else Restrictions
.Count
(R
) > Restrictions
.Value
(R
)
536 Restriction_Msg
(R
, N
);
539 -- For Max_Entries and the like, do not carry forward the violation
540 -- count because it does not affect later declarations.
542 if R
in Checked_Max_Parameter_Restrictions
then
543 Restrictions
.Count
(R
) := 0;
544 Restrictions
.Violated
(R
) := False;
546 end Check_Restriction
;
548 -------------------------------------
549 -- Check_Restriction_No_Dependence --
550 -------------------------------------
552 procedure Check_Restriction_No_Dependence
(U
: Node_Id
; Err
: Node_Id
) is
556 -- Ignore call if node U is not in the main source unit. This avoids
557 -- cascaded errors, e.g. when Ada.Containers units with other units.
558 -- However, allow Standard_Location here, since this catches some cases
559 -- of constructs that get converted to run-time calls.
561 if not In_Extended_Main_Source_Unit
(U
)
562 and then Sloc
(U
) /= Standard_Location
567 -- Loop through entries in No_Dependence table to check each one in turn
569 for J
in No_Dependences
.First
.. No_Dependences
.Last
loop
570 DU
:= No_Dependences
.Table
(J
).Unit
;
572 if Same_Unit
(U
, DU
) then
573 Error_Msg_Sloc
:= Sloc
(DU
);
574 Error_Msg_Node_1
:= DU
;
576 if No_Dependences
.Table
(J
).Warn
then
578 ("?*?violation of restriction `No_Dependence '='> &`#",
582 ("|violation of restriction `No_Dependence '='> &`#",
589 end Check_Restriction_No_Dependence
;
591 --------------------------------------------------
592 -- Check_Restriction_No_Specification_Of_Aspect --
593 --------------------------------------------------
595 procedure Check_Restriction_No_Specification_Of_Aspect
(N
: Node_Id
) is
600 -- Ignore call if no instances of this restriction set
602 if not No_Specification_Of_Aspect_Set
then
606 -- Ignore call if node N is not in the main source unit, since we only
607 -- give messages for the main unit. This avoids giving messages for
608 -- aspects that are specified in withed units.
610 if not In_Extended_Main_Source_Unit
(N
) then
614 if Nkind
(N
) = N_Pragma
then
615 Id
:= Pragma_Identifier
(N
);
616 elsif Nkind
(N
) = N_Attribute_Definition_Clause
then
619 Id
:= Identifier
(N
);
622 A_Id
:= Get_Aspect_Id
(Chars
(Id
));
623 pragma Assert
(A_Id
/= No_Aspect
);
625 Error_Msg_Sloc
:= No_Specification_Of_Aspects
(A_Id
);
627 if Error_Msg_Sloc
/= No_Location
then
628 Error_Msg_Node_1
:= Id
;
629 Error_Msg_Warn
:= No_Specification_Of_Aspect_Warning
(A_Id
);
631 ("<*<violation of restriction `No_Specification_Of_Aspect '='> &`#",
634 end Check_Restriction_No_Specification_Of_Aspect
;
636 -------------------------------------------
637 -- Check_Restriction_No_Use_Of_Attribute --
638 --------------------------------------------
640 procedure Check_Restriction_No_Use_Of_Attribute
(N
: Node_Id
) is
641 Attr_Id
: Attribute_Id
;
645 -- Nothing to do if the attribute is not in the main source unit, since
646 -- we only give messages for the main unit. This avoids giving messages
647 -- for attributes that are specified in withed units.
649 if not In_Extended_Main_Source_Unit
(N
) then
652 -- Nothing to do if not checking No_Use_Of_Attribute
654 elsif not No_Use_Of_Attribute_Set
then
657 -- Do not consider internally generated attributes because this leads to
660 elsif not Comes_From_Source
(N
) then
664 if Nkind
(N
) = N_Attribute_Definition_Clause
then
665 Attr_Nam
:= Chars
(N
);
667 pragma Assert
(Nkind
(N
) = N_Attribute_Reference
);
668 Attr_Nam
:= Attribute_Name
(N
);
671 Attr_Id
:= Get_Attribute_Id
(Attr_Nam
);
672 Error_Msg_Sloc
:= No_Use_Of_Attribute
(Attr_Id
);
674 if Error_Msg_Sloc
/= No_Location
then
675 Error_Msg_Name_1
:= Attr_Nam
;
676 Error_Msg_Warn
:= No_Use_Of_Attribute_Warning
(Attr_Id
);
678 ("<*<violation of restriction `No_Use_Of_Attribute '='> %` #", N
);
680 end Check_Restriction_No_Use_Of_Attribute
;
682 ----------------------------------------
683 -- Check_Restriction_No_Use_Of_Entity --
684 ----------------------------------------
686 procedure Check_Restriction_No_Use_Of_Entity
(N
: Node_Id
) is
688 -- Error defence (not clearly necessary, but better safe)
690 if No
(Entity
(N
)) then
694 -- If simple name of entity not flagged with Boolean2 flag, then there
695 -- cannot be a matching entry in the table, so skip the search.
697 if Get_Name_Table_Boolean2
(Chars
(Entity
(N
))) = False then
701 -- Restriction is only recognized within a configuration pragma file,
702 -- or within a unit of the main extended program. Note: the test for
703 -- Main_Unit is needed to properly include the case of configuration
706 if Current_Sem_Unit
/= Main_Unit
707 and then not In_Extended_Main_Source_Unit
(N
)
712 -- Here we must search the table
714 for J
in No_Use_Of_Entity
.First
.. No_Use_Of_Entity
.Last
loop
716 NE_Ent
: NE_Entry
renames No_Use_Of_Entity
.Table
(J
);
722 Expr
:= NE_Ent
.Entity
;
724 -- Here if at outer level of entity name in reference (handle
725 -- also the direct use of Text_IO in the pragma). For example:
726 -- pragma Restrictions (No_Use_Of_Entity => Text_IO.Put);
728 if Scope
(Ent
) = Standard_Standard
729 or else (Nkind
(Expr
) = N_Identifier
730 and then Chars
(Ent
) = Name_Text_IO
731 and then Chars
(Scope
(Ent
)) = Name_Ada
732 and then Scope
(Scope
(Ent
)) = Standard_Standard
)
734 if Nkind
(Expr
) in N_Identifier | N_Operator_Symbol
735 and then Chars
(Ent
) = Chars
(Expr
)
737 Error_Msg_Node_1
:= N
;
738 Error_Msg_Warn
:= NE_Ent
.Warn
;
739 Error_Msg_Sloc
:= Sloc
(NE_Ent
.Entity
);
741 ("<*<reference to & violates restriction "
742 & "No_Use_Of_Entity #", N
);
749 -- Here if at outer level of entity name in table
751 elsif Nkind
(Expr
) in N_Identifier | N_Operator_Symbol
then
754 -- Here if neither at the outer level
757 pragma Assert
(Nkind
(Expr
) = N_Selected_Component
);
758 exit when Chars
(Selector_Name
(Expr
)) /= Chars
(Ent
);
765 exit when not Is_Internal_Name
(Chars
(Ent
));
768 Expr
:= Prefix
(Expr
);
772 end Check_Restriction_No_Use_Of_Entity
;
774 ----------------------------------------
775 -- Check_Restriction_No_Use_Of_Pragma --
776 ----------------------------------------
778 procedure Check_Restriction_No_Use_Of_Pragma
(N
: Node_Id
) is
779 Id
: constant Node_Id
:= Pragma_Identifier
(N
);
780 P_Id
: constant Pragma_Id
:= Get_Pragma_Id
(Chars
(Id
));
783 -- Nothing to do if the pragma is not in the main source unit, since we
784 -- only give messages for the main unit. This avoids giving messages for
785 -- pragmas that are specified in withed units.
787 if not In_Extended_Main_Source_Unit
(N
) then
790 -- Nothing to do if not checking No_Use_Of_Pragma
792 elsif not No_Use_Of_Pragma_Set
then
795 -- Do not consider internally generated pragmas because this leads to
798 elsif not Comes_From_Source
(N
) then
802 Error_Msg_Sloc
:= No_Use_Of_Pragma
(P_Id
);
804 if Error_Msg_Sloc
/= No_Location
then
805 Error_Msg_Warn
:= No_Use_Of_Pragma_Warning
(P_Id
);
807 ("<*<violation of restriction `No_Use_Of_Pragma '='> &` #", Id
);
809 end Check_Restriction_No_Use_Of_Pragma
;
811 --------------------------------------
812 -- Check_Wide_Character_Restriction --
813 --------------------------------------
815 procedure Check_Wide_Character_Restriction
(E
: Entity_Id
; N
: Node_Id
) is
817 if Restriction_Check_Required
(No_Wide_Characters
)
818 and then Comes_From_Source
(N
)
821 T
: constant Entity_Id
:= Root_Type
(E
);
823 if T
= Standard_Wide_Character
or else
824 T
= Standard_Wide_String
or else
825 T
= Standard_Wide_Wide_Character
or else
826 T
= Standard_Wide_Wide_String
828 Check_Restriction
(No_Wide_Characters
, N
);
832 end Check_Wide_Character_Restriction
;
834 ----------------------------------------
835 -- Cunit_Boolean_Restrictions_Restore --
836 ----------------------------------------
838 procedure Cunit_Boolean_Restrictions_Restore
839 (R
: Save_Cunit_Boolean_Restrictions
)
842 for J
in Cunit_Boolean_Restrictions
loop
843 Restrictions
.Set
(J
) := R
(J
);
846 -- If No_Elaboration_Code set in configuration restrictions, and we
847 -- in the main extended source, then set it here now. This is part of
848 -- the special processing for No_Elaboration_Code.
850 if In_Extended_Main_Source_Unit
(Cunit_Entity
(Current_Sem_Unit
))
851 and then Config_Cunit_Boolean_Restrictions
(No_Elaboration_Code
)
853 Restrictions
.Set
(No_Elaboration_Code
) := True;
855 end Cunit_Boolean_Restrictions_Restore
;
857 -------------------------------------
858 -- Cunit_Boolean_Restrictions_Save --
859 -------------------------------------
861 function Cunit_Boolean_Restrictions_Save
862 return Save_Cunit_Boolean_Restrictions
864 R
: Save_Cunit_Boolean_Restrictions
;
867 for J
in Cunit_Boolean_Restrictions
loop
868 R
(J
) := Restrictions
.Set
(J
);
872 end Cunit_Boolean_Restrictions_Save
;
874 ------------------------
875 -- Get_Restriction_Id --
876 ------------------------
878 function Get_Restriction_Id
879 (N
: Name_Id
) return Restriction_Id
883 Set_Casing
(All_Upper_Case
);
885 for J
in All_Restrictions
loop
887 S
: constant String := Restriction_Id
'Image (J
);
889 if S
= Name_Buffer
(1 .. Name_Len
) then
895 return Not_A_Restriction_Id
;
896 end Get_Restriction_Id
;
898 -----------------------
899 -- Global_No_Tasking --
900 -----------------------
902 function Global_No_Tasking
return Boolean is
904 return Global_Restriction_No_Tasking
905 or else Targparm
.Restrictions_On_Target
.Set
(No_Tasking
);
906 end Global_No_Tasking
;
908 ---------------------------------------------
909 -- No_Dynamic_Accessibility_Checks_Enabled --
910 ---------------------------------------------
912 function No_Dynamic_Accessibility_Checks_Enabled
913 (N
: Node_Id
) return Boolean
915 pragma Unreferenced
(N
);
916 -- N is currently unreferenced but present for debugging purposes and
917 -- potential future use.
920 return Restrictions
.Set
(No_Dynamic_Accessibility_Checks
);
921 end No_Dynamic_Accessibility_Checks_Enabled
;
923 -------------------------------
924 -- No_Exception_Handlers_Set --
925 -------------------------------
927 function No_Exception_Handlers_Set
return Boolean is
929 return (No_Run_Time_Mode
or else Configurable_Run_Time_Mode
)
930 and then (Restrictions
.Set
(No_Exception_Handlers
)
932 Restrictions
.Set
(No_Exception_Propagation
));
933 end No_Exception_Handlers_Set
;
935 -------------------------------------
936 -- No_Exception_Propagation_Active --
937 -------------------------------------
939 function No_Exception_Propagation_Active
return Boolean is
941 return (No_Run_Time_Mode
942 or else Configurable_Run_Time_Mode
943 or else Debug_Flag_Dot_G
)
944 and then Restriction_Active
(No_Exception_Propagation
);
945 end No_Exception_Propagation_Active
;
947 --------------------------------
948 -- OK_No_Dependence_Unit_Name --
949 --------------------------------
951 function OK_No_Dependence_Unit_Name
(N
: Node_Id
) return Boolean is
953 if Nkind
(N
) = N_Selected_Component
then
955 OK_No_Dependence_Unit_Name
(Prefix
(N
))
957 OK_No_Dependence_Unit_Name
(Selector_Name
(N
));
959 elsif Nkind
(N
) = N_Identifier
then
963 Error_Msg_N
("wrong form for unit name for No_Dependence", N
);
966 end OK_No_Dependence_Unit_Name
;
968 ------------------------------
969 -- OK_No_Use_Of_Entity_Name --
970 ------------------------------
972 function OK_No_Use_Of_Entity_Name
(N
: Node_Id
) return Boolean is
974 if Nkind
(N
) = N_Selected_Component
then
976 OK_No_Use_Of_Entity_Name
(Prefix
(N
))
978 OK_No_Use_Of_Entity_Name
(Selector_Name
(N
));
980 elsif Nkind
(N
) in N_Identifier | N_Operator_Symbol
then
984 Error_Msg_N
("wrong form for entity name for No_Use_Of_Entity", N
);
987 end OK_No_Use_Of_Entity_Name
;
989 ----------------------------------
990 -- Process_Restriction_Synonyms --
991 ----------------------------------
993 -- Note: body of this function must be coordinated with list of renaming
994 -- declarations in System.Rident.
996 function Process_Restriction_Synonyms
(N
: Node_Id
) return Name_Id
is
997 Old_Name
: constant Name_Id
:= Chars
(N
);
1002 when Name_Boolean_Entry_Barriers
=>
1003 New_Name
:= Name_Simple_Barriers
;
1005 when Name_Max_Entry_Queue_Depth
=>
1006 New_Name
:= Name_Max_Entry_Queue_Length
;
1008 when Name_No_Dynamic_Interrupts
=>
1009 New_Name
:= Name_No_Dynamic_Attachment
;
1011 when Name_No_Requeue
=>
1012 New_Name
:= Name_No_Requeue_Statements
;
1014 when Name_No_Task_Attributes
=>
1015 New_Name
:= Name_No_Task_Attributes_Package
;
1021 -- Output warning if we are warning on obsolescent features.
1023 if Warn_On_Obsolescent_Feature
then
1024 Error_Msg_Name_1
:= Old_Name
;
1025 Error_Msg_N
("restriction identifier % is obsolescent?j?", N
);
1026 Error_Msg_Name_1
:= New_Name
;
1027 Error_Msg_N
("|use restriction identifier % instead?j?", N
);
1031 end Process_Restriction_Synonyms
;
1033 --------------------------------------
1034 -- Reset_Cunit_Boolean_Restrictions --
1035 --------------------------------------
1037 procedure Reset_Cunit_Boolean_Restrictions
is
1039 for J
in Cunit_Boolean_Restrictions
loop
1040 Restrictions
.Set
(J
) := False;
1042 end Reset_Cunit_Boolean_Restrictions
;
1044 -----------------------------------------------
1045 -- Restore_Config_Cunit_Boolean_Restrictions --
1046 -----------------------------------------------
1048 procedure Restore_Config_Cunit_Boolean_Restrictions
is
1050 Cunit_Boolean_Restrictions_Restore
(Config_Cunit_Boolean_Restrictions
);
1051 end Restore_Config_Cunit_Boolean_Restrictions
;
1053 ------------------------
1054 -- Restricted_Profile --
1055 ------------------------
1057 function Restricted_Profile
return Boolean is
1059 if Restricted_Profile_Cached
then
1060 return Restricted_Profile_Result
;
1063 Restricted_Profile_Result
:= True;
1064 Restricted_Profile_Cached
:= True;
1067 R
: Restriction_Flags
renames
1068 Profile_Info
(Restricted_Tasking
).Set
;
1069 V
: Restriction_Values
renames
1070 Profile_Info
(Restricted_Tasking
).Value
;
1072 for J
in R
'Range loop
1074 and then (Restrictions
.Set
(J
) = False
1075 or else Restriction_Warnings
(J
)
1077 (J
in All_Parameter_Restrictions
1078 and then Restrictions
.Value
(J
) > V
(J
)))
1080 Restricted_Profile_Result
:= False;
1085 return Restricted_Profile_Result
;
1088 end Restricted_Profile
;
1090 ------------------------
1091 -- Restriction_Active --
1092 ------------------------
1094 function Restriction_Active
(R
: All_Restrictions
) return Boolean is
1096 return Restrictions
.Set
(R
) and then not Restriction_Warnings
(R
);
1097 end Restriction_Active
;
1099 --------------------------------
1100 -- Restriction_Check_Required --
1101 --------------------------------
1103 function Restriction_Check_Required
(R
: All_Restrictions
) return Boolean is
1105 return Restrictions
.Set
(R
);
1106 end Restriction_Check_Required
;
1108 ---------------------
1109 -- Restriction_Msg --
1110 ---------------------
1112 procedure Restriction_Msg
(R
: Restriction_Id
; N
: Node_Id
) is
1113 Msg
: String (1 .. 100);
1116 procedure Add_Char
(C
: Character);
1117 -- Append given character to Msg, bumping Len
1119 procedure Add_Str
(S
: String);
1120 -- Append given string to Msg, bumping Len appropriately
1122 procedure Id_Case
(S
: String; Quotes
: Boolean := True);
1123 -- Given a string S, case it according to current identifier casing, and
1124 -- store in Error_Msg_String. Then append `~` to the message buffer
1125 -- to output the string unchanged surrounded in quotes. The quotes
1126 -- are suppressed if Quotes = False.
1132 procedure Add_Char
(C
: Character) is
1142 procedure Add_Str
(S
: String) is
1144 Msg
(Len
+ 1 .. Len
+ S
'Length) := S
;
1145 Len
:= Len
+ S
'Length;
1152 procedure Id_Case
(S
: String; Quotes
: Boolean := True) is
1154 Name_Buffer
(1 .. S
'Last) := S
;
1155 Name_Len
:= S
'Length;
1156 Set_Casing
(Identifier_Casing
(Get_Source_File_Index
(Sloc
(N
))));
1157 Error_Msg_Strlen
:= Name_Len
;
1158 Error_Msg_String
(1 .. Name_Len
) := Name_Buffer
(1 .. Name_Len
);
1167 -- Start of processing for Restriction_Msg
1170 -- Set warning message if warning
1172 if Restriction_Warnings
(R
) then
1175 -- If real violation (not warning), then mark it as non-serious unless
1176 -- it is a violation of No_Finalization in which case we leave it as a
1177 -- serious message, since otherwise we get crashes during attempts to
1178 -- expand stuff that is not properly formed due to assumptions made
1179 -- about no finalization being present.
1181 elsif R
/= No_Finalization
then
1185 Error_Msg_Sloc
:= Restrictions_Loc
(R
);
1187 -- Set main message, adding implicit if no source location
1189 if Error_Msg_Sloc
> No_Location
1190 or else Error_Msg_Sloc
= System_Location
1192 Add_Str
("violation of restriction ");
1194 Add_Str
("violation of implicit restriction ");
1195 Error_Msg_Sloc
:= No_Location
;
1198 -- Case of parameterized restriction
1200 if R
in All_Parameter_Restrictions
then
1202 Id_Case
(Restriction_Id
'Image (R
), Quotes
=> False);
1204 Error_Msg_Uint_1
:= UI_From_Int
(Int
(Restrictions
.Value
(R
)));
1206 -- Case of boolean restriction
1209 Id_Case
(Restriction_Id
'Image (R
));
1212 -- Case of no secondary profile continuation message
1214 if Restriction_Profile_Name
(R
) = No_Profile
then
1215 if Error_Msg_Sloc
/= No_Location
then
1220 Error_Msg_N
(Msg
(1 .. Len
), N
);
1222 -- Case of secondary profile continuation message present
1226 Error_Msg_N
(Msg
(1 .. Len
), N
);
1231 -- Set as warning if warning case
1233 if Restriction_Warnings
(R
) then
1239 Add_Str
("from profile ");
1240 Id_Case
(Profile_Name
'Image (Restriction_Profile_Name
(R
)));
1242 -- Add location if we have one
1244 if Error_Msg_Sloc
/= No_Location
then
1248 -- Output unconditional message and we are done
1251 Error_Msg_N
(Msg
(1 .. Len
), N
);
1253 end Restriction_Msg
;
1259 function Same_Entity
(E1
, E2
: Node_Id
) return Boolean is
1261 if Nkind
(E1
) in N_Identifier | N_Operator_Symbol
1263 Nkind
(E2
) in N_Identifier | N_Operator_Symbol
1265 return Chars
(E1
) = Chars
(E2
);
1267 elsif Nkind
(E1
) in N_Selected_Component | N_Expanded_Name
1269 Nkind
(E2
) in N_Selected_Component | N_Expanded_Name
1271 return Same_Unit
(Prefix
(E1
), Prefix
(E2
))
1273 Same_Unit
(Selector_Name
(E1
), Selector_Name
(E2
));
1283 function Same_Unit
(U1
, U2
: Node_Id
) return Boolean is
1285 if Nkind
(U1
) = N_Identifier
and then Nkind
(U2
) = N_Identifier
then
1286 return Chars
(U1
) = Chars
(U2
);
1288 elsif Nkind
(U1
) in N_Selected_Component | N_Expanded_Name
1290 Nkind
(U2
) in N_Selected_Component | N_Expanded_Name
1292 return Same_Unit
(Prefix
(U1
), Prefix
(U2
))
1294 Same_Unit
(Selector_Name
(U1
), Selector_Name
(U2
));
1300 --------------------------------------------
1301 -- Save_Config_Cunit_Boolean_Restrictions --
1302 --------------------------------------------
1304 procedure Save_Config_Cunit_Boolean_Restrictions
is
1306 Config_Cunit_Boolean_Restrictions
:= Cunit_Boolean_Restrictions_Save
;
1307 end Save_Config_Cunit_Boolean_Restrictions
;
1309 ------------------------------
1310 -- Set_Profile_Restrictions --
1311 ------------------------------
1313 procedure Set_Profile_Restrictions
1318 R
: Restriction_Flags
renames Profile_Info
(P
).Set
;
1319 V
: Restriction_Values
renames Profile_Info
(P
).Value
;
1322 for J
in R
'Range loop
1325 Already_Restricted
: constant Boolean := Restriction_Active
(J
);
1328 -- Set the restriction
1330 if J
in All_Boolean_Restrictions
then
1331 Set_Restriction
(J
, N
);
1333 Set_Restriction
(J
, N
, V
(J
));
1336 -- Record that this came from a Profile[_Warnings] restriction
1338 Restriction_Profile_Name
(J
) := P
;
1340 -- Set warning flag, except that we do not set the warning
1341 -- flag if the restriction was already active and this is
1342 -- the warning case. That avoids a warning overriding a real
1343 -- restriction, which should never happen.
1345 if not (Warn
and Already_Restricted
) then
1346 Restriction_Warnings
(J
) := Warn
;
1351 end Set_Profile_Restrictions
;
1353 ---------------------
1354 -- Set_Restriction --
1355 ---------------------
1357 procedure Set_Restriction
1358 (R
: All_Boolean_Restrictions
;
1362 Restrictions
.Set
(R
) := True;
1364 if Restricted_Profile_Cached
and Restricted_Profile_Result
then
1367 Restricted_Profile_Cached
:= False;
1370 -- Set location, but preserve location of system restriction for nice
1371 -- error msg with run time name.
1373 if Restrictions_Loc
(R
) /= System_Location
then
1374 Restrictions_Loc
(R
) := Sloc
(N
);
1377 -- Note restriction came from restriction pragma, not profile
1379 Restriction_Profile_Name
(R
) := No_Profile
;
1381 -- Record the restriction if we are in the main unit, or in the extended
1382 -- main unit. The reason that we test separately for Main_Unit is that
1383 -- gnat.adc is processed with Current_Sem_Unit = Main_Unit, but nodes in
1384 -- gnat.adc do not appear to be in the extended main source unit (they
1385 -- probably should do ???)
1387 if Current_Sem_Unit
= Main_Unit
1388 or else In_Extended_Main_Source_Unit
(N
)
1390 if not Restriction_Warnings
(R
) then
1391 Main_Restrictions
.Set
(R
) := True;
1394 end Set_Restriction
;
1396 procedure Set_Restriction
1397 (R
: All_Parameter_Restrictions
;
1402 if Restricted_Profile_Cached
and Restricted_Profile_Result
then
1405 Restricted_Profile_Cached
:= False;
1408 if Restrictions
.Set
(R
) then
1409 if V
< Restrictions
.Value
(R
) then
1410 Restrictions
.Value
(R
) := V
;
1411 Restrictions_Loc
(R
) := Sloc
(N
);
1415 Restrictions
.Set
(R
) := True;
1416 Restrictions
.Value
(R
) := V
;
1417 Restrictions_Loc
(R
) := Sloc
(N
);
1420 -- Record the restriction if we are in the main unit, or in the extended
1421 -- main unit. The reason that we test separately for Main_Unit is that
1422 -- gnat.adc is processed with Current_Sem_Unit = Main_Unit, but nodes in
1423 -- gnat.adc do not appear to be the extended main source unit (they
1424 -- probably should do ???)
1426 if Current_Sem_Unit
= Main_Unit
1427 or else In_Extended_Main_Source_Unit
(N
)
1429 if Main_Restrictions
.Set
(R
) then
1430 if V
< Main_Restrictions
.Value
(R
) then
1431 Main_Restrictions
.Value
(R
) := V
;
1434 elsif not Restriction_Warnings
(R
) then
1435 Main_Restrictions
.Set
(R
) := True;
1436 Main_Restrictions
.Value
(R
) := V
;
1440 -- Note restriction came from restriction pragma, not profile
1442 Restriction_Profile_Name
(R
) := No_Profile
;
1443 end Set_Restriction
;
1445 procedure Set_Restriction
1446 (R
: All_Restrictions
;
1449 V
: Integer := Integer'First)
1451 Set
: Boolean := True;
1453 if Warn
and then Restriction_Active
(R
) then
1458 if R
in All_Boolean_Restrictions
then
1459 Set_Restriction
(R
, N
);
1461 Set_Restriction
(R
, N
, V
);
1464 Restriction_Warnings
(R
) := Warn
;
1466 end Set_Restriction
;
1468 -----------------------------------
1469 -- Set_Restriction_No_Dependence --
1470 -----------------------------------
1472 procedure Set_Restriction_No_Dependence
1475 Profile
: Profile_Name
:= No_Profile
)
1478 -- Loop to check for duplicate entry
1480 for J
in No_Dependences
.First
.. No_Dependences
.Last
loop
1482 -- Case of entry already in table
1484 if Same_Unit
(Unit
, No_Dependences
.Table
(J
).Unit
) then
1486 -- Error has precedence over warning
1489 No_Dependences
.Table
(J
).Warn
:= False;
1496 -- Entry is not currently in table
1498 No_Dependences
.Append
((Unit
, Warn
, Profile
));
1499 end Set_Restriction_No_Dependence
;
1501 --------------------------------------
1502 -- Set_Restriction_No_Use_Of_Entity --
1503 --------------------------------------
1505 procedure Set_Restriction_No_Use_Of_Entity
1508 Profile
: Profile_Name
:= No_Profile
)
1513 -- Loop to check for duplicate entry
1515 for J
in No_Use_Of_Entity
.First
.. No_Use_Of_Entity
.Last
loop
1517 -- Case of entry already in table
1519 if Same_Entity
(Entity
, No_Use_Of_Entity
.Table
(J
).Entity
) then
1521 -- Error has precedence over warning
1524 No_Use_Of_Entity
.Table
(J
).Warn
:= False;
1531 -- Entry is not currently in table
1533 No_Use_Of_Entity
.Append
((Entity
, Warn
, Profile
));
1535 -- Now we need to find the direct name and set Boolean2 flag
1537 if Nkind
(Entity
) in N_Identifier | N_Operator_Symbol
then
1541 pragma Assert
(Nkind
(Entity
) = N_Selected_Component
);
1542 Nam
:= Selector_Name
(Entity
);
1543 pragma Assert
(Nkind
(Nam
) in N_Identifier | N_Operator_Symbol
);
1546 Set_Name_Table_Boolean2
(Chars
(Nam
), True);
1547 end Set_Restriction_No_Use_Of_Entity
;
1549 ------------------------------------------------
1550 -- Set_Restriction_No_Specification_Of_Aspect --
1551 ------------------------------------------------
1553 procedure Set_Restriction_No_Specification_Of_Aspect
1557 A_Id
: constant Aspect_Id_Exclude_No_Aspect
:= Get_Aspect_Id
(Chars
(N
));
1560 No_Specification_Of_Aspect_Set
:= True;
1561 No_Specification_Of_Aspects
(A_Id
) := Sloc
(N
);
1562 No_Specification_Of_Aspect_Warning
(A_Id
) := Warn
;
1563 end Set_Restriction_No_Specification_Of_Aspect
;
1565 procedure Set_Restriction_No_Specification_Of_Aspect
(A_Id
: Aspect_Id
) is
1567 No_Specification_Of_Aspect_Set
:= True;
1568 No_Specification_Of_Aspects
(A_Id
) := System_Location
;
1569 No_Specification_Of_Aspect_Warning
(A_Id
) := False;
1570 end Set_Restriction_No_Specification_Of_Aspect
;
1572 -----------------------------------------
1573 -- Set_Restriction_No_Use_Of_Attribute --
1574 -----------------------------------------
1576 procedure Set_Restriction_No_Use_Of_Attribute
1580 A_Id
: constant Attribute_Id
:= Get_Attribute_Id
(Chars
(N
));
1583 No_Use_Of_Attribute_Set
:= True;
1584 No_Use_Of_Attribute
(A_Id
) := Sloc
(N
);
1585 No_Use_Of_Attribute_Warning
(A_Id
) := Warn
;
1586 end Set_Restriction_No_Use_Of_Attribute
;
1588 procedure Set_Restriction_No_Use_Of_Attribute
(A_Id
: Attribute_Id
) is
1590 No_Use_Of_Attribute_Set
:= True;
1591 No_Use_Of_Attribute
(A_Id
) := System_Location
;
1592 No_Use_Of_Attribute_Warning
(A_Id
) := False;
1593 end Set_Restriction_No_Use_Of_Attribute
;
1595 --------------------------------------
1596 -- Set_Restriction_No_Use_Of_Pragma --
1597 --------------------------------------
1599 procedure Set_Restriction_No_Use_Of_Pragma
1603 A_Id
: constant Pragma_Id
:= Get_Pragma_Id
(Chars
(N
));
1606 No_Use_Of_Pragma_Set
:= True;
1607 No_Use_Of_Pragma
(A_Id
) := Sloc
(N
);
1608 No_Use_Of_Pragma_Warning
(A_Id
) := Warn
;
1609 end Set_Restriction_No_Use_Of_Pragma
;
1611 procedure Set_Restriction_No_Use_Of_Pragma
(A_Id
: Pragma_Id
) is
1613 No_Use_Of_Pragma_Set
:= True;
1614 No_Use_Of_Pragma
(A_Id
) := System_Location
;
1615 No_Use_Of_Pragma_Warning
(A_Id
) := False;
1616 end Set_Restriction_No_Use_Of_Pragma
;
1618 ---------------------------
1619 -- Set_Global_No_Tasking --
1620 ---------------------------
1622 procedure Set_Global_No_Tasking
is
1624 Global_Restriction_No_Tasking
:= True;
1625 end Set_Global_No_Tasking
;
1627 ----------------------------------
1628 -- Suppress_Restriction_Message --
1629 ----------------------------------
1631 function Suppress_Restriction_Message
(N
: Node_Id
) return Boolean is
1633 -- We only output messages for the extended main source unit
1635 if In_Extended_Main_Source_Unit
(N
) then
1638 -- If loaded by rtsfind, then suppress message
1640 elsif Sloc
(N
) <= No_Location
then
1643 -- Otherwise suppress message if internal file
1646 return In_Internal_Unit
(N
);
1648 end Suppress_Restriction_Message
;
1650 ---------------------
1651 -- Tasking_Allowed --
1652 ---------------------
1654 function Tasking_Allowed
return Boolean is
1656 return not Restrictions
.Set
(No_Tasking
)
1657 and then (not Restrictions
.Set
(Max_Tasks
)
1658 or else Restrictions
.Value
(Max_Tasks
) > 0)
1659 and then not No_Run_Time_Mode
;
1660 end Tasking_Allowed
;