types.ads, [...]: Minor reformatting.

2013-01-04  Robert Dewar  <dewar@adacore.com>

	* types.ads, prj-conf.adb, par-tchk.adb: Minor reformatting.

2013-01-04  Robert Dewar  <dewar@adacore.com>

	* par-ch6.adb (P_Subprogram): Better handling of missing IS
	after expression function.
	* par-util.adb (No_Constraint): Improve handling to avoid bad warnings.

2013-01-04  Robert Dewar  <dewar@adacore.com>

	* exp_util.ads, exp_util.adb (Insert_Actions): In expression with
	actions case, new actions are appended to the sequence rather than
	prepended.

2013-01-04  Robert Dewar  <dewar@adacore.com>

	* gnat_ugn.texi: Document -gnatw.d/w.D (does no apply in VMS mode).
	* usage.adb: Add lines for -gnatw.d/w.D switches.
	* warnsw.adb: Minor fixes (some missing cases of setting
	Warning_Doc_Switch). Reject -gnatw.d and -gnatw.D in VMS mode.

From-SVN: r194895
This commit is contained in:
Robert Dewar 2013-01-04 09:28:49 +00:00 committed by Arnaud Charlet
parent 67b8ac46a6
commit 7fcd29e08c
11 changed files with 113 additions and 27 deletions

View file

@ -1,3 +1,26 @@
2013-01-04 Robert Dewar <dewar@adacore.com>
* types.ads, prj-conf.adb, par-tchk.adb: Minor reformatting.
2013-01-04 Robert Dewar <dewar@adacore.com>
* par-ch6.adb (P_Subprogram): Better handling of missing IS
after expression function.
* par-util.adb (No_Constraint): Improve handling to avoid bad warnings.
2013-01-04 Robert Dewar <dewar@adacore.com>
* exp_util.ads, exp_util.adb (Insert_Actions): In expression with
actions case, new actions are appended to the sequence rather than
prepended.
2013-01-04 Robert Dewar <dewar@adacore.com>
* gnat_ugn.texi: Document -gnatw.d/w.D (does no apply in VMS mode).
* usage.adb: Add lines for -gnatw.d/w.D switches.
* warnsw.adb: Minor fixes (some missing cases of setting
Warning_Doc_Switch). Reject -gnatw.d and -gnatw.D in VMS mode.
2013-01-04 Robert Dewar <dewar@adacore.com>
* exp_util.adb (Remove_Side_Effects): Make sure scope suppress

View file

@ -3138,7 +3138,7 @@ package body Exp_Util is
and then not Is_Frozen (Current_Scope)
then
if No (Scope_Stack.Table
(Scope_Stack.Last).Pending_Freeze_Actions)
(Scope_Stack.Last).Pending_Freeze_Actions)
then
Scope_Stack.Table (Scope_Stack.Last).Pending_Freeze_Actions :=
Ins_Actions;
@ -3306,13 +3306,13 @@ package body Exp_Util is
return;
-- Case of appearing within an Expressions_With_Actions node. We
-- prepend the actions to the list of actions already there, if
-- append the actions to the list of actions already there, if
-- the node has not been analyzed yet. Otherwise find insertion
-- location further up the tree.
when N_Expression_With_Actions =>
if not Analyzed (P) then
Prepend_List (Ins_Actions, Actions (P));
Append_List (Ins_Actions, Actions (P));
return;
end if;

View file

@ -75,6 +75,9 @@ package Exp_Util is
-- expansion of the N_If_Expression node rewrites the node so that the
-- actions can be positioned normally.
-- For actions coming from expansion of the expression in an expression
-- with actions node, the action is appended to the list of actions.
-- Basically what we do is to climb up to the tree looking for the
-- proper insertion point, as described by one of the above cases,
-- and then insert the appropriate action or actions.

View file

@ -5214,6 +5214,9 @@ individually controlled. The warnings that are not turned on by this
switch are
@option{-gnatwd} (implicit dereferencing),
@option{-gnatwh} (hiding),
@ifclear VMS
@option{-gnatw.d} (tag warnings with -gnatw switch)
@end ifclear
@option{-gnatw.h} (holes (gaps) in record layouts)
@option{-gnatw.i} (overlapping actuals),
@option{-gnatw.k} (redefinition of names in standard),
@ -5362,6 +5365,24 @@ this warning option.
This switch suppresses warnings for implicit dereferences in
indexed components, slices, and selected components.
@ifclear vms
@item -gnatw.d
@emph{Activate tagging of warning messages.}
@cindex @option{-gnatw.d} (@command{gcc})
If this switch is set, then warning messages are tagged, either with
the string ``@option{-gnatw?}'' showing which switch controls the warning,
or with ``[enabled by default]'' if the warning is not under control of a
specific @option{-gnatw?} switch. This mode is off by default, and is not
affected by the use of @code{-gnatwa}.
@item -gnatw.D
@emph{Deactivate tagging of warning messages.}
@cindex @option{-gnatw.d} (@command{gcc})
If this switch is set, then warning messages return to the default
mode in which warnings are not tagged as described above for
@code{-gnatw.d}.
@end ifclear
@item -gnatwe
@emph{Treat warnings and style checks as errors.}
@cindex @option{-gnatwe} (@command{gcc})

View file

@ -592,15 +592,26 @@ package body Ch6 is
elsif Aspect_Specifications_Present then
goto Subprogram_Declaration;
-- Here we have a missing IS or missing semicolon, we always guess
-- a missing semicolon, since we are pretty good at fixing up a
-- semicolon which should really be an IS
-- Here we have a missing IS or missing semicolon
else
Error_Msg_AP -- CODEFIX
("|missing "";""");
SIS_Missing_Semicolon_Message := Get_Msg_Id;
goto Subprogram_Declaration;
-- If the next token is a left paren at the start of a line, then
-- this is almost certainly the start of the expression for an
-- expression function, so in this case guess a missing IS.
if Token = Tok_Left_Paren and then Token_Is_At_Start_Of_Line then
Error_Msg_AP -- CODEFIX
("missing IS");
-- In all other cases, we guess a missing semicolon, since we are
-- good at fixing up a semicolon which should really be an IS.
else
Error_Msg_AP -- CODEFIX
("|missing "";""");
SIS_Missing_Semicolon_Message := Get_Msg_Id;
goto Subprogram_Declaration;
end if;
end if;
end if;

View file

@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
-- Copyright (C) 1992-2010, Free Software Foundation, Inc. --
-- Copyright (C) 1992-2012, 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- --
@ -452,10 +452,10 @@ package body Tchk is
Scan;
return;
-- An interesting little kludge here. If the previous token is a
-- semicolon, then there is no way that we can legitimately need another
-- semicolon. This could only arise in an error situation where an error
-- has already been signalled. By simply ignoring the request for a
-- An interesting little kludge. If the previous token is a semicolon,
-- then there is no way that we can legitimately need another semicolon.
-- This could only arise in an error situation where an error has
-- already been signalled. By simply ignoring the request for a
-- semicolon in this case, we avoid some spurious missing semicolon
-- messages.
@ -474,9 +474,7 @@ package body Tchk is
-- Deal with pragma. If pragma is not at start of line, it is considered
-- misplaced otherwise we treat it as a normal missing semicolon case.
elsif Token = Tok_Pragma
and then not Token_Is_At_Start_Of_Line
then
elsif Token = Tok_Pragma and then not Token_Is_At_Start_Of_Line then
P_Pragmas_Misplaced;
if Token = Tok_Semicolon then

View file

@ -635,6 +635,15 @@ package body Util is
procedure No_Constraint is
begin
-- If next token is at start of line, don't object, it seems relatively
-- unlikely that a constraint would be on its own starting a line.
if Token_Is_At_Start_Of_Line then
return;
end if;
-- Otherwise if we have a token that could start a constraint, object
if Token in Token_Class_Consk then
Error_Msg_SC ("constraint not allowed here");
Discard_Junk_Node (P_Constraint_Opt);

View file

@ -688,9 +688,9 @@ package body Prj.Conf is
if Switch.Value /= No_Name then
Get_Name_String (Switch.Value);
if Conf_File_Name'Length = 0 and then
Name_Len > 9 and then
Name_Buffer (1 .. 9) = "--config="
if Conf_File_Name'Length = 0
and then Name_Len > 9
and then Name_Buffer (1 .. 9) = "--config="
then
Conf_File_Name :=
new String'(Name_Buffer (10 .. Name_Len));
@ -1357,7 +1357,7 @@ package body Prj.Conf is
end if;
if Config_File_Path = null then
if (not Allow_Automatic_Generation)
if not Allow_Automatic_Generation
and then Conf_File_Name'Length > 0
then
Raise_Invalid_Config

View file

@ -257,13 +257,13 @@ package Types is
-- possible values for each of the above types is disjoint so that this
-- distinction is possible.
type Union_Id is new Int;
-- The type in the tree for a union of possible ID values
-- Note: it is also helpful for debugging purposes to make these ranges
-- distinct. If a bug leads to misidentification of a value, then it will
-- typically result in an out of range value and a Constraint_Error.
type Union_Id is new Int;
-- The type in the tree for a union of possible ID values
List_Low_Bound : constant := -100_000_000;
-- The List_Id values are subscripts into an array of list headers which
-- has List_Low_Bound as its lower bound. This value is chosen so that all

View file

@ -474,6 +474,16 @@ begin
Write_Line (" .C* turn off warnings for unrepped components");
Write_Line (" d turn on warnings for implicit dereference");
Write_Line (" D* turn off warnings for implicit dereference");
-- Switches -gnatw.d/w.D not available on VMS
if not OpenVMS_On_Target then
Write_Line
(" .d turn on tagging of warnings with -gnatw switch");
Write_Line
(" .D* turn off tagging of warnings with -gnatw switch");
end if;
Write_Line (" e treat all warnings (but not info) as errors");
Write_Line (" .e turn on every optional info/warning " &
"(no exceptions)");

View file

@ -53,10 +53,18 @@ package body Warnsw is
Warn_On_Unrepped_Components := False;
when 'd' =>
Warning_Doc_Switch := True;
if Open_VMS_On_Target then
return False;
end if;
Warning_Doc_Switch := True;
when 'D' =>
Warning_Doc_Switch := False;
if Open_VMS_On_Target then
return False;
end if;
Warning_Doc_Switch := False;
when 'e' =>
Address_Clause_Overlay_Warnings := True;
@ -68,6 +76,7 @@ package body Warnsw is
Implementation_Unit_Warnings := True;
Ineffective_Inline_Warnings := True;
List_Inherited_Aspects := True;
Warning_Doc_Switch := True;
Warn_On_Ada_2005_Compatibility := True;
Warn_On_Ada_2012_Compatibility := True;
Warn_On_All_Unread_Out_Parameters := True;
@ -217,6 +226,7 @@ package body Warnsw is
Implementation_Unit_Warnings := False;
Ineffective_Inline_Warnings := True;
List_Inherited_Aspects := False;
Warning_Doc_Switch := False;
Warn_On_Ada_2005_Compatibility := True;
Warn_On_Ada_2012_Compatibility := True;
Warn_On_All_Unread_Out_Parameters := False;
@ -296,6 +306,7 @@ package body Warnsw is
Implementation_Unit_Warnings := False;
Ineffective_Inline_Warnings := False;
List_Inherited_Aspects := False;
Warning_Doc_Switch := False;
Warn_On_Ada_2005_Compatibility := False;
Warn_On_Ada_2012_Compatibility := False;
Warn_On_All_Unread_Out_Parameters := False;