Commit 3ec54569 by Pierre-Marie de Rodat

[multiple changes]

2017-11-09  Pascal Obry  <obry@adacore.com>

	* libgnarl/s-taprop__mingw.adb: On Windows, initialize the thead handle
	only for foreign threads.  We initialize the thread handle only if not
	yet initialized. This happens in Enter_Task for foreign threads only.
	But for native threads (Ada tasking) we do want to keep the real
	handle (from Create_Task) to be able to free the corresponding
	resources in Finalize_TCB (CloseHandle).

2017-11-09  Yannick Moy  <moy@adacore.com>

	* sem_attr.adb (Analyze_Attribute): Default initialize P_Type,
	P_Base_Type.
	(Error_Attr_P): Fix name in pragma No_Return.
	(Unexpected_Argument): Add pragma No_Return.
	(Placement_Error): Add pragma No_Return.

2017-11-09  Javier Miranda  <miranda@adacore.com>

	* exp_disp.adb (Elab_Flag_Needed): Elaboration flag not needed when the
	dispatch table is statically built.
	(Make_DT): Declare constant the Interface_Table object associated with
	an statically built dispatch table. For this purpose the Offset_To_Top
	value of each interface is computed using the dummy object.
	* exp_ch3.adb (Build_Init_Procedure): Do not generate code initializing
	the Offset_To_Top field of secondary dispatch tables when the dispatch
	table is statically built.
	(Initialize_Tag): Do not generate calls to Register_Interface_Offset
	when the dispatch table is statically built.
	* doc/gnat_rm/standard_and_implementation_defined_restrictions.rst:
	Document the new GNAT restriction Static_Dispatch_Tables.
	* gnat_rm.texi: Regenerate.

2017-11-09  Hristian Kirtchev  <kirtchev@adacore.com>

	* sem_aggr.adb (Resolve_Delta_Record_Aggregate): Reorder declarations
	to avoid a dormant bug.

2017-11-09  Jerome Lambourg  <lambourg@adacore.com>

	* init.c: Define missing __gnat_alternate_stack for QNX. Set it to 0,
	as such capability is not available on the OS.
	* link.c: Make sure linker options for QNX are correct.
	* libgnarl/s-osinte__qnx.ads: Add some missing bindings to pthread.
	* libgnarl/s-taprop__qnx.adb: New, derived from s-taprop__posix.adb. This brings
	in particular a workaround with locks priority ceiling where a higher
	priority task is allowed to lock a lower ceiling priority lock. This
	also fixes the scheduling of FIFO tasks when the priority of a task is
	lowered.
	* libgnat/system-qnx-aarch64.ads: Fix priority ranges.

2017-11-09  Yannick Moy  <moy@adacore.com>

	* erroutc.adb (Output_Error_Msgs): Justify CodePeer false positive
	message.
	* gnatbind.adb (Scan_Bind_Arg): Simplify test to remove always true
	condition.
	* namet.adb (Copy_One_Character): Add assumption for static analysis,
	as knowledge that Hex(2) is in the range 0..255 is too complex for
	CodePeer.
	(Finalize): Add assumption for static analysis, as the fact that there
	are symbols in the table depends on a global invariant at this point in
	the program.
	* set_targ.adb (Check_Spaces): Justify CodePeer false positive message.
	* stylesw.adb (Save_Style_Check_Options): Rewrite to avoid test always
	true.

From-SVN: r254573
parent 6214b83b
2017-11-09 Pascal Obry <obry@adacore.com>
* libgnarl/s-taprop__mingw.adb: On Windows, initialize the thead handle
only for foreign threads. We initialize the thread handle only if not
yet initialized. This happens in Enter_Task for foreign threads only.
But for native threads (Ada tasking) we do want to keep the real
handle (from Create_Task) to be able to free the corresponding
resources in Finalize_TCB (CloseHandle).
2017-11-09 Yannick Moy <moy@adacore.com>
* sem_attr.adb (Analyze_Attribute): Default initialize P_Type,
P_Base_Type.
(Error_Attr_P): Fix name in pragma No_Return.
(Unexpected_Argument): Add pragma No_Return.
(Placement_Error): Add pragma No_Return.
2017-11-09 Javier Miranda <miranda@adacore.com>
* exp_disp.adb (Elab_Flag_Needed): Elaboration flag not needed when the
dispatch table is statically built.
(Make_DT): Declare constant the Interface_Table object associated with
an statically built dispatch table. For this purpose the Offset_To_Top
value of each interface is computed using the dummy object.
* exp_ch3.adb (Build_Init_Procedure): Do not generate code initializing
the Offset_To_Top field of secondary dispatch tables when the dispatch
table is statically built.
(Initialize_Tag): Do not generate calls to Register_Interface_Offset
when the dispatch table is statically built.
* doc/gnat_rm/standard_and_implementation_defined_restrictions.rst:
Document the new GNAT restriction Static_Dispatch_Tables.
* gnat_rm.texi: Regenerate.
2017-11-09 Hristian Kirtchev <kirtchev@adacore.com>
* sem_aggr.adb (Resolve_Delta_Record_Aggregate): Reorder declarations
to avoid a dormant bug.
2017-11-09 Jerome Lambourg <lambourg@adacore.com>
* init.c: Define missing __gnat_alternate_stack for QNX. Set it to 0,
as such capability is not available on the OS.
* link.c: Make sure linker options for QNX are correct.
* libgnarl/s-osinte__qnx.ads: Add some missing bindings to pthread.
* libgnarl/s-taprop__qnx.adb: New, derived from s-taprop__posix.adb. This brings
in particular a workaround with locks priority ceiling where a higher
priority task is allowed to lock a lower ceiling priority lock. This
also fixes the scheduling of FIFO tasks when the priority of a task is
lowered.
* libgnat/system-qnx-aarch64.ads: Fix priority ranges.
2017-11-09 Yannick Moy <moy@adacore.com>
* erroutc.adb (Output_Error_Msgs): Justify CodePeer false positive
message.
* gnatbind.adb (Scan_Bind_Arg): Simplify test to remove always true
condition.
* namet.adb (Copy_One_Character): Add assumption for static analysis,
as knowledge that Hex(2) is in the range 0..255 is too complex for
CodePeer.
(Finalize): Add assumption for static analysis, as the fact that there
are symbols in the table depends on a global invariant at this point in
the program.
* set_targ.adb (Check_Spaces): Justify CodePeer false positive message.
* stylesw.adb (Save_Style_Check_Options): Rewrite to avoid test always
true.
2017-11-09 Javier Miranda <miranda@adacore.com> 2017-11-09 Javier Miranda <miranda@adacore.com>
* libgnat/s-rident.ads (Static_Dispatch_Tables): New restriction name. * libgnat/s-rident.ads (Static_Dispatch_Tables): New restriction name.
......
...@@ -988,6 +988,13 @@ appear, and that no wide or wide wide string or character literals ...@@ -988,6 +988,13 @@ appear, and that no wide or wide wide string or character literals
appear in the program (that is literals representing characters not in appear in the program (that is literals representing characters not in
type ``Character``). type ``Character``).
Static_Dispatch_Tables
----------------------
.. index:: Static_Dispatch_Tables
[GNAT] This restriction ensures at compile time that all the artifacts
associated with dispatch tables can be placed in read-only memory.
SPARK_05 SPARK_05
-------- --------
.. index:: SPARK_05 .. index:: SPARK_05
......
...@@ -512,6 +512,9 @@ package body Erroutc is ...@@ -512,6 +512,9 @@ package body Erroutc is
-- so now we output a tab to match up with the text. -- so now we output a tab to match up with the text.
if Src (P) = ASCII.HT then if Src (P) = ASCII.HT then
pragma Annotate
(CodePeer, False_Positive, "validity check",
"Src(P) is initialized at this point");
Write_Char (ASCII.HT); Write_Char (ASCII.HT);
P := P + 1; P := P + 1;
......
...@@ -2544,6 +2544,7 @@ package body Exp_Ch3 is ...@@ -2544,6 +2544,7 @@ package body Exp_Ch3 is
and then Has_Interfaces (Rec_Type) and then Has_Interfaces (Rec_Type)
then then
declare declare
Elab_List : List_Id := New_List;
Elab_Sec_DT_Stmts_List : constant List_Id := New_List; Elab_Sec_DT_Stmts_List : constant List_Id := New_List;
begin begin
...@@ -2555,24 +2556,30 @@ package body Exp_Ch3 is ...@@ -2555,24 +2556,30 @@ package body Exp_Ch3 is
Fixed_Comps => True, Fixed_Comps => True,
Variable_Comps => False); Variable_Comps => False);
Elab_List := New_List (
Make_If_Statement (Loc,
Condition => New_Occurrence_Of (Set_Tag, Loc),
Then_Statements => Init_Tags_List));
if Elab_Flag_Needed (Rec_Type) then
Append_To (Elab_Sec_DT_Stmts_List, Append_To (Elab_Sec_DT_Stmts_List,
Make_Assignment_Statement (Loc, Make_Assignment_Statement (Loc,
Name => Name =>
New_Occurrence_Of New_Occurrence_Of
(Access_Disp_Table_Elab_Flag (Rec_Type), Loc), (Access_Disp_Table_Elab_Flag (Rec_Type),
Loc),
Expression => Expression =>
New_Occurrence_Of (Standard_False, Loc))); New_Occurrence_Of (Standard_False, Loc)));
Prepend_List_To (Body_Stmts, New_List ( Append_To (Elab_List,
Make_If_Statement (Loc,
Condition => New_Occurrence_Of (Set_Tag, Loc),
Then_Statements => Init_Tags_List),
Make_If_Statement (Loc, Make_If_Statement (Loc,
Condition => Condition =>
New_Occurrence_Of New_Occurrence_Of
(Access_Disp_Table_Elab_Flag (Rec_Type), Loc), (Access_Disp_Table_Elab_Flag (Rec_Type), Loc),
Then_Statements => Elab_Sec_DT_Stmts_List))); Then_Statements => Elab_Sec_DT_Stmts_List));
end if;
Prepend_List_To (Body_Stmts, Elab_List);
end; end;
else else
Prepend_To (Body_Stmts, Prepend_To (Body_Stmts,
...@@ -8588,7 +8595,9 @@ package body Exp_Ch3 is ...@@ -8588,7 +8595,9 @@ package body Exp_Ch3 is
-- Offset_Value => n, -- Offset_Value => n,
-- Offset_Func => null); -- Offset_Func => null);
if RTE_Available (RE_Register_Interface_Offset) then if not Building_Static_Secondary_DT (Typ)
and then RTE_Available (RE_Register_Interface_Offset)
then
Append_To (Stmts_List, Append_To (Stmts_List,
Make_Procedure_Call_Statement (Loc, Make_Procedure_Call_Statement (Loc,
Name => Name =>
......
...@@ -677,7 +677,8 @@ package body Exp_Disp is ...@@ -677,7 +677,8 @@ package body Exp_Disp is
begin begin
return Ada_Version >= Ada_2005 return Ada_Version >= Ada_2005
and then not Is_Interface (Typ) and then not Is_Interface (Typ)
and then Has_Interfaces (Typ); and then Has_Interfaces (Typ)
and then not Building_Static_DT (Typ);
end Elab_Flag_Needed; end Elab_Flag_Needed;
----------------------------- -----------------------------
...@@ -5515,9 +5516,21 @@ package body Exp_Disp is ...@@ -5515,9 +5516,21 @@ package body Exp_Disp is
declare declare
TSD_Ifaces_List : constant List_Id := New_List; TSD_Ifaces_List : constant List_Id := New_List;
Elmt : Elmt_Id; Elmt : Elmt_Id;
Ifaces_List : Elist_Id;
Ifaces_Comp_List : Elist_Id;
Ifaces_Tag_List : Elist_Id;
Offset_To_Top : Node_Id;
Sec_DT_Tag : Node_Id; Sec_DT_Tag : Node_Id;
begin begin
-- Collect interfaces information if we need to compute the
-- offset to the top using the dummy object.
if Present (Dummy_Object) then
Collect_Interfaces_Info (Typ,
Ifaces_List, Ifaces_Comp_List, Ifaces_Tag_List);
end if;
AI := First_Elmt (Typ_Ifaces); AI := First_Elmt (Typ_Ifaces);
while Present (AI) loop while Present (AI) loop
if Is_Ancestor (Node (AI), Typ, Use_Full_View => True) then if Is_Ancestor (Node (AI), Typ, Use_Full_View => True) then
...@@ -5552,6 +5565,46 @@ package body Exp_Disp is ...@@ -5552,6 +5565,46 @@ package body Exp_Disp is
Loc); Loc);
end if; end if;
-- For static dispatch tables compute Offset_To_Top using
-- the dummy object.
if Present (Dummy_Object) then
declare
Iface : constant Node_Id := Node (AI);
Iface_Comp : Node_Id := Empty;
Iface_Comp_Elmt : Elmt_Id;
Iface_Elmt : Elmt_Id;
begin
Iface_Elmt := First_Elmt (Ifaces_List);
Iface_Comp_Elmt := First_Elmt (Ifaces_Comp_List);
while Present (Iface_Elmt) loop
if Node (Iface_Elmt) = Iface then
Iface_Comp := Node (Iface_Comp_Elmt);
exit;
end if;
Next_Elmt (Iface_Elmt);
Next_Elmt (Iface_Comp_Elmt);
end loop;
pragma Assert (Present (Iface_Comp));
Offset_To_Top :=
Make_Op_Minus (Loc,
Make_Attribute_Reference (Loc,
Prefix =>
Make_Selected_Component (Loc,
Prefix =>
New_Occurrence_Of (Dummy_Object, Loc),
Selector_Name =>
New_Occurrence_Of (Iface_Comp, Loc)),
Attribute_Name => Name_Position));
end;
else
Offset_To_Top := Make_Integer_Literal (Loc, 0);
end if;
Append_To (TSD_Ifaces_List, Append_To (TSD_Ifaces_List,
Make_Aggregate (Loc, Make_Aggregate (Loc,
Expressions => New_List ( Expressions => New_List (
...@@ -5569,7 +5622,7 @@ package body Exp_Disp is ...@@ -5569,7 +5622,7 @@ package body Exp_Disp is
-- Offset_To_Top_Value -- Offset_To_Top_Value
Make_Integer_Literal (Loc, 0), Offset_To_Top,
-- Offset_To_Top_Func -- Offset_To_Top_Func
...@@ -5589,17 +5642,15 @@ package body Exp_Disp is ...@@ -5589,17 +5642,15 @@ package body Exp_Disp is
Set_Is_Statically_Allocated (ITable, Set_Is_Statically_Allocated (ITable,
Is_Library_Level_Tagged_Type (Typ)); Is_Library_Level_Tagged_Type (Typ));
-- The table of interfaces is not constant; its slots are -- The table of interfaces is constant if we are building a
-- filled at run time by the IP routine using attribute -- static dispatch table; otherwise is not constant because
-- 'Position to know the location of the tag components -- its slots are filled at run time by the IP routine.
-- (and this attribute cannot be safely used before the
-- object is initialized).
Append_To (Result, Append_To (Result,
Make_Object_Declaration (Loc, Make_Object_Declaration (Loc,
Defining_Identifier => ITable, Defining_Identifier => ITable,
Aliased_Present => True, Aliased_Present => True,
Constant_Present => False, Constant_Present => Present (Dummy_Object),
Object_Definition => Object_Definition =>
Make_Subtype_Indication (Loc, Make_Subtype_Indication (Loc,
Subtype_Mark => Subtype_Mark =>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -330,9 +330,7 @@ procedure Gnatbind is ...@@ -330,9 +330,7 @@ procedure Gnatbind is
then then
Output_File_Name_Seen := True; Output_File_Name_Seen := True;
if Argv'Length = 0 if Argv'Length = 0 or else Argv (1) = '-' then
or else (Argv'Length >= 1 and then Argv (1) = '-')
then
Fail ("output File_Name missing after -o"); Fail ("output File_Name missing after -o");
else else
......
...@@ -2568,6 +2568,10 @@ __gnat_error_handler (int sig, siginfo_t *si, void *ucontext) ...@@ -2568,6 +2568,10 @@ __gnat_error_handler (int sig, siginfo_t *si, void *ucontext)
(__sigtramphandler_t *)&__gnat_map_signal); (__sigtramphandler_t *)&__gnat_map_signal);
} }
/* This must be in keeping with System.OS_Interface.Alternate_Stack_Size. */
/* sigaltstack is currently not supported by QNX7 */
char __gnat_alternate_stack[0];
void void
__gnat_install_handler (void) __gnat_install_handler (void)
{ {
......
...@@ -796,7 +796,17 @@ package body System.Task_Primitives.Operations is ...@@ -796,7 +796,17 @@ package body System.Task_Primitives.Operations is
raise Invalid_CPU_Number; raise Invalid_CPU_Number;
end if; end if;
-- Initialize the thread here only if not set. This is done for a
-- foreign task but is not needed when a real thread-id is already
-- set in Create_Task. Note that we do want to keep the real thread-id
-- as it is the only way to free the associated resource. Another way
-- to say this is that a pseudo thread-id from a foreign thread won't
-- allow for freeing resources.
if Self_ID.Common.LL.Thread = Null_Thread_Id then
Self_ID.Common.LL.Thread := GetCurrentThread; Self_ID.Common.LL.Thread := GetCurrentThread;
end if;
Self_ID.Common.LL.Thread_Id := GetCurrentThreadId; Self_ID.Common.LL.Thread_Id := GetCurrentThreadId;
Get_Stack_Bounds Get_Stack_Bounds
......
...@@ -95,20 +95,22 @@ package System is ...@@ -95,20 +95,22 @@ package System is
-- Priority-related Declarations (RM D.1) -- Priority-related Declarations (RM D.1)
-- System priority is Ada priority + 1, so lies in the range 1 .. 63.
--
-- If the scheduling policy is SCHED_FIFO or SCHED_RR the runtime makes use -- If the scheduling policy is SCHED_FIFO or SCHED_RR the runtime makes use
-- of the entire range provided by the system. -- of the entire range provided by the system.
-- --
-- If the scheduling policy is SCHED_OTHER the only valid system priority -- If the scheduling policy is SCHED_OTHER the only valid system priority
-- is 1 and other values are simply ignored. -- is 1 and other values are simply ignored.
Max_Priority : constant Positive := 62; Max_Priority : constant Positive := 61;
Max_Interrupt_Priority : constant Positive := 63; Max_Interrupt_Priority : constant Positive := 62;
subtype Any_Priority is Integer range 0 .. 63; subtype Any_Priority is Integer range 0 .. 62;
subtype Priority is Any_Priority range 0 .. 62; subtype Priority is Any_Priority range 0 .. 61;
subtype Interrupt_Priority is Any_Priority range 63 .. 63; subtype Interrupt_Priority is Any_Priority range 62 .. 62;
Default_Priority : constant Priority := 31; Default_Priority : constant Priority := 30;
private private
......
...@@ -105,6 +105,7 @@ const char *__gnat_default_libgcc_subdir = "lib"; ...@@ -105,6 +105,7 @@ const char *__gnat_default_libgcc_subdir = "lib";
#elif defined (__FreeBSD__) || defined (__DragonFly__) \ #elif defined (__FreeBSD__) || defined (__DragonFly__) \
|| defined (__NetBSD__) || defined (__OpenBSD__) || defined (__NetBSD__) || defined (__OpenBSD__)
|| defined (__QNX__)
const char *__gnat_object_file_option = "-Wl,@"; const char *__gnat_object_file_option = "-Wl,@";
const char *__gnat_run_path_option = "-Wl,-rpath,"; const char *__gnat_run_path_option = "-Wl,-rpath,";
char __gnat_shared_libgnat_default = STATIC; char __gnat_shared_libgnat_default = STATIC;
......
...@@ -258,7 +258,13 @@ package body Namet is ...@@ -258,7 +258,13 @@ package body Namet is
-- simply use their normal representation. -- simply use their normal representation.
else else
Insert_Character (Character'Val (Hex (2))); declare
W2 : constant Word := Hex (2);
begin
pragma Assume (W2 <= 255);
-- Add assumption to facilitate static analysis
Insert_Character (Character'Val (W2));
end;
end if; end if;
-- WW (wide wide character insertion) -- WW (wide wide character insertion)
...@@ -753,6 +759,9 @@ package body Namet is ...@@ -753,6 +759,9 @@ package body Namet is
Write_Eol; Write_Eol;
Write_Str ("Average number of probes for lookup = "); Write_Str ("Average number of probes for lookup = ");
pragma Assume (Nsyms /= 0);
-- Add assumption to facilitate static analysis. Here Nsyms cannot be
-- zero because many symbols are added to the table by default.
Probes := Probes / Nsyms; Probes := Probes / Nsyms;
Write_Int (Probes / 200); Write_Int (Probes / 200);
Write_Char ('.'); Write_Char ('.');
......
...@@ -2878,6 +2878,13 @@ package body Sem_Aggr is ...@@ -2878,6 +2878,13 @@ package body Sem_Aggr is
------------------------------------ ------------------------------------
procedure Resolve_Delta_Record_Aggregate (N : Node_Id; Typ : Entity_Id) is procedure Resolve_Delta_Record_Aggregate (N : Node_Id; Typ : Entity_Id) is
-- Variables used to verify that discriminant-dependent components
-- appear in the same variant.
Comp_Ref : Entity_Id;
Variant : Node_Id;
procedure Check_Variant (Id : Entity_Id); procedure Check_Variant (Id : Entity_Id);
-- If a given component of the delta aggregate appears in a variant -- If a given component of the delta aggregate appears in a variant
-- part, verify that it is within the same variant as that of previous -- part, verify that it is within the same variant as that of previous
...@@ -2900,17 +2907,13 @@ package body Sem_Aggr is ...@@ -2900,17 +2907,13 @@ package body Sem_Aggr is
procedure Check_Variant (Id : Entity_Id) is procedure Check_Variant (Id : Entity_Id) is
Comp : Entity_Id; Comp : Entity_Id;
Comp_Ref : Entity_Id;
Comp_Variant : Node_Id; Comp_Variant : Node_Id;
Variant : Node_Id;
begin begin
if not Has_Discriminants (Typ) then if not Has_Discriminants (Typ) then
return; return;
end if; end if;
Variant := Empty;
Comp := First_Entity (Typ); Comp := First_Entity (Typ);
while Present (Comp) loop while Present (Comp) loop
exit when Chars (Comp) = Chars (Id); exit when Chars (Comp) = Chars (Id);
...@@ -3027,6 +3030,8 @@ package body Sem_Aggr is ...@@ -3027,6 +3030,8 @@ package body Sem_Aggr is
-- Start of processing for Resolve_Delta_Record_Aggregate -- Start of processing for Resolve_Delta_Record_Aggregate
begin begin
Variant := Empty;
Assoc := First (Deltas); Assoc := First (Deltas);
while Present (Assoc) loop while Present (Assoc) loop
Choice := First (Choice_List (Assoc)); Choice := First (Choice_List (Assoc));
......
...@@ -231,10 +231,10 @@ package body Sem_Attr is ...@@ -231,10 +231,10 @@ package body Sem_Attr is
E1 : Node_Id; E1 : Node_Id;
E2 : Node_Id; E2 : Node_Id;
P_Type : Entity_Id; P_Type : Entity_Id := Empty;
-- Type of prefix after analysis -- Type of prefix after analysis
P_Base_Type : Entity_Id; P_Base_Type : Entity_Id := Empty;
-- Base type of prefix after analysis -- Base type of prefix after analysis
----------------------- -----------------------
...@@ -419,7 +419,7 @@ package body Sem_Attr is ...@@ -419,7 +419,7 @@ package body Sem_Attr is
-- required error messages. -- required error messages.
procedure Error_Attr_P (Msg : String); procedure Error_Attr_P (Msg : String);
pragma No_Return (Error_Attr); pragma No_Return (Error_Attr_P);
-- Like Error_Attr, but error is posted at the start of the prefix -- Like Error_Attr, but error is posted at the start of the prefix
procedure Legal_Formal_Attribute; procedure Legal_Formal_Attribute;
...@@ -446,7 +446,9 @@ package body Sem_Attr is ...@@ -446,7 +446,9 @@ package body Sem_Attr is
-- node in the aspect case). -- node in the aspect case).
procedure Unexpected_Argument (En : Node_Id); procedure Unexpected_Argument (En : Node_Id);
-- Signal unexpected attribute argument (En is the argument) pragma No_Return (Unexpected_Argument);
-- Signal unexpected attribute argument (En is the argument), and then
-- raises Bad_Attribute to avoid any further semantic processing.
procedure Validate_Non_Static_Attribute_Function_Call; procedure Validate_Non_Static_Attribute_Function_Call;
-- Called when processing an attribute that is a function call to a -- Called when processing an attribute that is a function call to a
...@@ -1108,8 +1110,10 @@ package body Sem_Attr is ...@@ -1108,8 +1110,10 @@ package body Sem_Attr is
-- node Nod is within enclosing node Encl_Nod. -- node Nod is within enclosing node Encl_Nod.
procedure Placement_Error; procedure Placement_Error;
pragma No_Return (Placement_Error);
-- Emit a general error when the attributes does not appear in a -- Emit a general error when the attributes does not appear in a
-- postcondition-like aspect or pragma. -- postcondition-like aspect or pragma, and then raises Bad_Attribute
-- to avoid any further semantic processing.
------------------------------ ------------------------------
-- Check_Placement_In_Check -- -- Check_Placement_In_Check --
......
...@@ -604,6 +604,10 @@ package body Set_Targ is ...@@ -604,6 +604,10 @@ package body Set_Targ is
procedure Check_Spaces is procedure Check_Spaces is
begin begin
if N > Buflen or else Buffer (N) /= ' ' then if N > Buflen or else Buffer (N) /= ' ' then
pragma Annotate
(CodePeer, False_Positive, "condition predetermined",
"N may be less than Buflen when calling Check_Spaces");
FailN ("missing space for"); FailN ("missing space for");
end if; end if;
......
...@@ -161,7 +161,8 @@ package body Stylesw is ...@@ -161,7 +161,8 @@ package body Stylesw is
if Style_Check_Comments then if Style_Check_Comments then
if Style_Check_Comments_Spacing = 2 then if Style_Check_Comments_Spacing = 2 then
Add ('c', Style_Check_Comments); Add ('c', Style_Check_Comments);
elsif Style_Check_Comments_Spacing = 1 then else
pragma Assert (Style_Check_Comments_Spacing = 1);
Add ('C', Style_Check_Comments); Add ('C', Style_Check_Comments);
end if; end if;
end if; end if;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment