Commit 005ae225 by Arnaud Charlet

[multiple changes]

2009-08-07  Robert Dewar  <dewar@adacore.com>

	* sem_warn.adb (Warn_On_Unreferenced_Entity): Fix obvious typo.

2009-08-07  Vincent Celier  <celier@adacore.com>

	* gnatcmd.adb (GNATCmd): If -U is not used, one and only one main is
	specified on the command line and there are switches in the Compiler
	package of the project file, use these compilation switches to invoke
	the tool.

2009-08-07  Ben Brosgol  <brosgol@adacore.com>

	* gnat_ugn.texi: Wordsmithing edits at beginning of gnatcheck chapter.

2009-08-07  Ed Schonberg  <schonberg@adacore.com>

	* sem_ch10.adb (Analyze_Proper_Body): Indicate name of missing subunit
	even if not in main unit, to simplify debugging.

2009-08-07  Arnaud Charlet  <charlet@adacore.com>

	* gcc-interface/Makefile.in: Fix handling of GCC_FOR_TARGET.
	* gcc-interface/Make-lang.in: Update dependencies.

From-SVN: r150564
parent fb25a60d
2009-08-07 Robert Dewar <dewar@adacore.com> 2009-08-07 Robert Dewar <dewar@adacore.com>
* sem_warn.adb (Warn_On_Unreferenced_Entity): Fix obvious typo.
2009-08-07 Vincent Celier <celier@adacore.com>
* gnatcmd.adb (GNATCmd): If -U is not used, one and only one main is
specified on the command line and there are switches in the Compiler
package of the project file, use these compilation switches to invoke
the tool.
2009-08-07 Ben Brosgol <brosgol@adacore.com>
* gnat_ugn.texi: Wordsmithing edits at beginning of gnatcheck chapter.
2009-08-07 Ed Schonberg <schonberg@adacore.com>
* sem_ch10.adb (Analyze_Proper_Body): Indicate name of missing subunit
even if not in main unit, to simplify debugging.
2009-08-07 Arnaud Charlet <charlet@adacore.com>
* gcc-interface/Makefile.in: Fix handling of GCC_FOR_TARGET.
* gcc-interface/Make-lang.in: Update dependencies.
2009-08-07 Robert Dewar <dewar@adacore.com>
* types.ads: Minor reformatting * types.ads: Minor reformatting
* sem_ch12.ads (Check_Generic_Child_Unit): Add missing documentation. * sem_ch12.ads (Check_Generic_Child_Unit): Add missing documentation.
* frontend.adb, sem_warn.adb, sem_warn.ads: Fix spelling of * frontend.adb, sem_warn.adb, sem_warn.ads: Fix spelling of
......
...@@ -3235,17 +3235,18 @@ ada/sem_ch13.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \ ...@@ -3235,17 +3235,18 @@ ada/sem_ch13.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \ ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \
ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/rtsfind.adb \ ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/rtsfind.adb \
ada/sem.ads ada/sem_aux.ads ada/sem_ch13.ads ada/sem_ch13.adb \ ada/sem.ads ada/sem_aux.ads ada/sem_ch13.ads ada/sem_ch13.adb \
ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_dist.ads ada/sem_eval.ads \ ada/sem_ch3.ads ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_dist.ads \
ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads ada/sem_warn.ads \ ada/sem_eval.ads ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads \
ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \ ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
ada/stringt.ads ada/system.ads ada/s-exctab.ads ada/s-htable.ads \ ada/snames.ads ada/stand.ads ada/stringt.ads ada/system.ads \
ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads \ ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads \
ada/s-rident.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \ ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads ada/s-soflin.ads \
ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads \ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \ ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
ada/targparm.ads ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads \ ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \
ada/ttypes.ads ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \ ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \
ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/urealp.adb ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \
ada/unchdeal.ads ada/urealp.ads ada/urealp.adb
ada/sem_ch2.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \ ada/sem_ch2.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/a-uncdea.ads ada/alloc.ads ada/atree.ads ada/atree.adb \ ada/a-uncdea.ads ada/alloc.ads ada/atree.ads ada/atree.adb \
......
...@@ -2349,7 +2349,7 @@ install-gnatlib: ../stamp-gnatlib-$(RTSDIR) ...@@ -2349,7 +2349,7 @@ install-gnatlib: ../stamp-gnatlib-$(RTSDIR)
gnatlib: ../stamp-gnatlib1-$(RTSDIR) ../stamp-gnatlib2-$(RTSDIR) gnatlib: ../stamp-gnatlib1-$(RTSDIR) ../stamp-gnatlib2-$(RTSDIR)
$(MAKE) -C $(RTSDIR) \ $(MAKE) -C $(RTSDIR) \
CC="`echo \"$(GCC_FOR_TARGET)\" \ CC="`echo \"$(GCC_FOR_TARGET)\" \
| sed -e 's,^\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'`" \ | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'`" \
INCLUDES="$(INCLUDES_FOR_SUBDIR) -I./../.." \ INCLUDES="$(INCLUDES_FOR_SUBDIR) -I./../.." \
CFLAGS="$(GNATLIBCFLAGS_FOR_C)" \ CFLAGS="$(GNATLIBCFLAGS_FOR_C)" \
FORCE_DEBUG_ADAFLAGS="$(FORCE_DEBUG_ADAFLAGS)" \ FORCE_DEBUG_ADAFLAGS="$(FORCE_DEBUG_ADAFLAGS)" \
...@@ -2357,7 +2357,7 @@ gnatlib: ../stamp-gnatlib1-$(RTSDIR) ../stamp-gnatlib2-$(RTSDIR) ...@@ -2357,7 +2357,7 @@ gnatlib: ../stamp-gnatlib1-$(RTSDIR) ../stamp-gnatlib2-$(RTSDIR)
-f ../Makefile $(LIBGNAT_OBJS) -f ../Makefile $(LIBGNAT_OBJS)
$(MAKE) -C $(RTSDIR) \ $(MAKE) -C $(RTSDIR) \
CC="`echo \"$(GCC_FOR_TARGET)\" \ CC="`echo \"$(GCC_FOR_TARGET)\" \
| sed -e 's,^\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'`" \ | sed -e 's,\./xgcc,../../xgcc,' -e 's,-B\./,-B../../,'`" \
ADA_INCLUDES="" \ ADA_INCLUDES="" \
CFLAGS="$(GNATLIBCFLAGS)" \ CFLAGS="$(GNATLIBCFLAGS)" \
ADAFLAGS="$(GNATLIBFLAGS)" \ ADAFLAGS="$(GNATLIBFLAGS)" \
......
...@@ -20689,7 +20689,8 @@ rules to be checked by @command{gnatcheck} (@pxref{gnatcheck Rule Options}). ...@@ -20689,7 +20689,8 @@ rules to be checked by @command{gnatcheck} (@pxref{gnatcheck Rule Options}).
@end itemize @end itemize
@noindent @noindent
Either a @file{@var{filename}} or an @file{@var{arg_list_filename}} must be supplied. Either a @file{@var{filename}} or an @file{@var{arg_list_filename}} must be
supplied.
@menu @menu
* Format of the Report File:: * Format of the Report File::
...@@ -20709,18 +20710,18 @@ Either a @file{@var{filename}} or an @file{@var{arg_list_filename}} must be supp ...@@ -20709,18 +20710,18 @@ Either a @file{@var{filename}} or an @file{@var{arg_list_filename}} must be supp
The @command{gnatcheck} tool outputs on @file{stdout} all messages concerning The @command{gnatcheck} tool outputs on @file{stdout} all messages concerning
rule violations. rule violations.
It also creates a text file that It also creates a text file that
contains the complete report of the last gnatcheck run. By default this file is contains the complete report of the last gnatcheck run. By default this file
named named @file{^gnatcheck.out^GNATCHECK.OUT^} and it is located in the current is named named @file{^gnatcheck.out^GNATCHECK.OUT^} and it is located in the
directory, @option{^-o^/OUTPUT^} option can be used to change the name and/or current directory; the @option{^-o^/OUTPUT^} option can be used to change the
location of the report file. This report contains: name and/or location of the report file. This report contains:
@itemize @bullet @itemize @bullet
@item date and time of @command{gnatcheck} run, the version of @item date and time of @command{gnatcheck} run, the version of
the tool that has generated this report and the full paarmeters the tool that has generated this report and the full parameters
of the @command{gnatcheck} invocation; of the @command{gnatcheck} invocation;
@item the list of enabled rules; @item list of enabled rules;
@item the total number of detected violations; @item total number of detected violations;
@item list of source files for that rule violations have been detected; @item list of source files where rule violations have been detected;
@item list of source files with no violations detected; @item list of source files where no violations have been detected.
@end itemize @end itemize
@node General gnatcheck Switches @node General gnatcheck Switches
...@@ -20734,7 +20735,7 @@ The following switches control the general @command{gnatcheck} behavior ...@@ -20734,7 +20735,7 @@ The following switches control the general @command{gnatcheck} behavior
@cindex @option{^-a^/ALL^} (@command{gnatcheck}) @cindex @option{^-a^/ALL^} (@command{gnatcheck})
@item ^-a^/ALL^ @item ^-a^/ALL^
Process all units including those with read-only ALI files such as Process all units including those with read-only ALI files such as
those from GNAT Run-Time library. those from the GNAT Run-Time library.
@ifclear vms @ifclear vms
@ignore @ignore
...@@ -20745,7 +20746,7 @@ Debug mode ...@@ -20745,7 +20746,7 @@ Debug mode
@cindex @option{-dd} (@command{gnatcheck}) @cindex @option{-dd} (@command{gnatcheck})
@item -dd @item -dd
Progress indicator mode (for use in GPS) Progress indicator mode (for use in GPS).
@end ifclear @end ifclear
@cindex @option{^-h^/HELP^} (@command{gnatcheck}) @cindex @option{^-h^/HELP^} (@command{gnatcheck})
...@@ -20762,19 +20763,20 @@ instantiated. ...@@ -20762,19 +20763,20 @@ instantiated.
@cindex @option{^-log^/LOG^} (@command{gnatcheck}) @cindex @option{^-log^/LOG^} (@command{gnatcheck})
@item ^-log^/LOG^ @item ^-log^/LOG^
Duplicate all the output sent to Stderr into a log file. The log file is Duplicate all the output sent to @file{stderr} into a log file. The log file
named @var{gnatcheck.log} and is located in the current directory. is named @file{gnatcheck.log} and is located in the current directory.
@cindex @option{^-m^/DIAGNOSTIC_LIMIT^} (@command{gnatcheck}) @cindex @option{^-m^/DIAGNOSTIC_LIMIT^} (@command{gnatcheck})
@item ^-m@i{nnn}^/DIAGNOSTIC_LIMIT=@i{nnn}^ @item ^-m@i{nnnn}^/DIAGNOSTIC_LIMIT=@i{nnnn}^
Maximum number of diagnoses to be sent to Stdout, @i{nnn} from o@dots{}1000, Maximum number of diagnostics to be sent to @file{stdout}, where @i{nnnn} is in
the range 0@dots{}1000;
the default value is 500. Zero means that there is no limitation on the default value is 500. Zero means that there is no limitation on
the number of diagnostic messages to be printed into Stdout. the number of diagnostic messages to be output.
@cindex @option{^-q^/QUIET^} (@command{gnatcheck}) @cindex @option{^-q^/QUIET^} (@command{gnatcheck})
@item ^-q^/QUIET^ @item ^-q^/QUIET^
Quiet mode. All the diagnoses about rule violations are placed in the Quiet mode. All the diagnostics about rule violations are placed in the
@command{gnatcheck} report file only, without duplicating in @file{stdout}. @command{gnatcheck} report file only, without duplication on @file{stdout}.
@cindex @option{^-s^/SHORT^} (@command{gnatcheck}) @cindex @option{^-s^/SHORT^} (@command{gnatcheck})
@item ^-s^/SHORT^ @item ^-s^/SHORT^
...@@ -20787,11 +20789,11 @@ Include the compiler-style section in the report file ...@@ -20787,11 +20789,11 @@ Include the compiler-style section in the report file
@cindex @option{^-s2^/BY_RULES^} (@command{gnatcheck}) @cindex @option{^-s2^/BY_RULES^} (@command{gnatcheck})
@item ^-s2^/BY_RULES^ @item ^-s2^/BY_RULES^
Include the section containing diagnoses ordered by rules in the report file Include the section containing diagnostics ordered by rules in the report file
@cindex @option{^-s3^/BY_FILES_BY_RULES^} (@command{gnatcheck}) @cindex @option{^-s3^/BY_FILES_BY_RULES^} (@command{gnatcheck})
@item ^-s3^/BY_FILES_BY_RULES^ @item ^-s3^/BY_FILES_BY_RULES^
Include the section containing diagnoses ordered by files and then by rules Include the section containing diagnostics ordered by files and then by rules
in the report file in the report file
@cindex @option{^-t^/TIME^} (@command{gnatcheck}) @cindex @option{^-t^/TIME^} (@command{gnatcheck})
...@@ -20884,30 +20886,43 @@ the following rule identifiers and parameters: ...@@ -20884,30 +20886,43 @@ the following rule identifiers and parameters:
@table @option @table @option
@item Restrictions @item Restrictions
To record restrictions violations (that are performed by the compiler if the To record restrictions violations (which are performed by the compiler if the
pragma @code{Restrictions} or @code{Restriction_Warnings} are given), pragma @code{Restrictions} or @code{Restriction_Warnings} are given),
use the rule named use the @code{Restrictions} rule
@code{Restrictions} with the same parameters as pragma with the same parameters as pragma
@code{Restrictions} or @code{Restriction_Warnings}. @code{Restrictions} or @code{Restriction_Warnings}.
@item Style_Checks @item Style_Checks
To record compiler style checks(@pxref{Style Checking}), use the rule named To record compiler style checks (@pxref{Style Checking}), use the
@code{Style_Checks}. A parameter of this rule can be either @code{All_Checks}, @code{Style_Checks} rule.
which enables all the standard style checks that corresponds to @option{-gnatyy} This rule takes a parameter in one of the following forms:
GNAT style check option, or a string that has exactly the same @itemize
structure and semantics as the @code{string_LITERAL} parameter of GNAT pragma @item
@code{Style_Checks} (for further information about this pragma, @code{All_Checks},
@pxref{Pragma Style_Checks,,, gnat_rm, GNAT Reference Manual}). For example, which enables the standard style checks corresponding to the @option{-gnatyy}
@code{+RStyle_Checks:O} rule option activates and adds to @command{gnatcheck} GNAT style check option, or
output the compiler style check that corresponds to
@item
a string with the same
structure and semantics as the @code{string_LITERAL} parameter of the
GNAT pragma @code{Style_Checks}
(for further information about this pragma,
@pxref{Pragma Style_Checks,,, gnat_rm, GNAT Reference Manual}).
@end itemize
@noindent
For example, the
@code{+RStyle_Checks:O} rule option activates
the compiler style check that corresponds to
@code{-gnatyO} style check option. @code{-gnatyO} style check option.
@item Warnings @item Warnings
To record compiler warnings (@pxref{Warning Message Control}), use the rule To record compiler warnings (@pxref{Warning Message Control}), use the
named @code{Warnings} with a parameter that is a valid @code{Warnings} rule with a parameter that is a valid
@i{static_string_expression} argument of GNAT pragma @code{Warnings} @i{static_string_expression} argument of the GNAT pragma @code{Warnings}
(for further information about this pragma, @pxref{Pragma Warnings,,, (for further information about this pragma,
gnat_rm, GNAT Reference Manual}). Note, that in case of gnatcheck @pxref{Pragma Warnings,,,gnat_rm, GNAT Reference Manual}).
Note that in case of gnatcheck
's' parameter, that corresponds to the GNAT @option{-gnatws} option, disables 's' parameter, that corresponds to the GNAT @option{-gnatws} option, disables
all the specific warnings, but not suppresses the warning mode, all the specific warnings, but not suppresses the warning mode,
and 'e' parameter, corresponding to @option{-gnatwe} that means and 'e' parameter, corresponding to @option{-gnatwe} that means
...@@ -20999,7 +21014,7 @@ pragma Annotate (gnatcheck, @i{exemption_control}, @i{Rule_Name}, [@i{justificat ...@@ -20999,7 +21014,7 @@ pragma Annotate (gnatcheck, @i{exemption_control}, @i{Rule_Name}, [@i{justificat
@end smallexample @end smallexample
@noindent @noindent
When a @command{gnatcheck} annotatation has more then four arguments, When a @command{gnatcheck} annotation has more then four arguments,
@command{gnatcheck} issues a warning and ignores the additional arguments. @command{gnatcheck} issues a warning and ignores the additional arguments.
If the additional arguments do not follow the syntax above, If the additional arguments do not follow the syntax above,
@command{gnatcheck} emits a warning and ignores the annotation. @command{gnatcheck} emits a warning and ignores the annotation.
...@@ -1308,10 +1308,8 @@ begin ...@@ -1308,10 +1308,8 @@ begin
Normalize_Pathname Normalize_Pathname
(Command (Command'First .. Index)); (Command (Command'First .. Index));
PATH : constant String := PATH : constant String :=
Absolute_Dir & Absolute_Dir & Path_Separator & Getenv ("PATH").all;
Path_Separator &
Getenv ("PATH").all;
begin begin
Setenv ("PATH", PATH); Setenv ("PATH", PATH);
...@@ -1460,6 +1458,7 @@ begin ...@@ -1460,6 +1458,7 @@ begin
begin begin
if The_Command = Stack then if The_Command = Stack then
-- Never call gnatstack with a prefix -- Never call gnatstack with a prefix
Program := new String'(Command_List (The_Command).Unixcmd.all); Program := new String'(Command_List (The_Command).Unixcmd.all);
...@@ -1488,68 +1487,56 @@ begin ...@@ -1488,68 +1487,56 @@ begin
end loop; end loop;
end if; end if;
-- For BIND, CHECK, ELIM, FIND, LINK, LIST, PRETTY, STACK, STUB, -- For BIND, CHECK, ELIM, FIND, LINK, LIST, METRIC, PRETTY, STACK, STUB,
-- METRIC ad XREF, look for project file related switches. -- SYNC and XREF, look for project file related switches.
if The_Command = Bind case The_Command is
or else The_Command = Check when Bind =>
or else The_Command = Sync Tool_Package_Name := Name_Binder;
or else The_Command = Elim Packages_To_Check := Packages_To_Check_By_Binder;
or else The_Command = Find when Check =>
or else The_Command = Link Tool_Package_Name := Name_Check;
or else The_Command = List Packages_To_Check := Packages_To_Check_By_Check;
or else The_Command = Xref when Elim =>
or else The_Command = Pretty Tool_Package_Name := Name_Eliminate;
or else The_Command = Stack Packages_To_Check := Packages_To_Check_By_Eliminate;
or else The_Command = Stub when Find =>
or else The_Command = Metric Tool_Package_Name := Name_Finder;
then Packages_To_Check := Packages_To_Check_By_Finder;
case The_Command is when Link =>
when Bind => Tool_Package_Name := Name_Linker;
Tool_Package_Name := Name_Binder; Packages_To_Check := Packages_To_Check_By_Linker;
Packages_To_Check := Packages_To_Check_By_Binder; when List =>
when Check => Tool_Package_Name := Name_Gnatls;
Tool_Package_Name := Name_Check; Packages_To_Check := Packages_To_Check_By_Gnatls;
Packages_To_Check := Packages_To_Check_By_Check; when Metric =>
when Sync => Tool_Package_Name := Name_Metrics;
Tool_Package_Name := Name_Synchronize; Packages_To_Check := Packages_To_Check_By_Metric;
Packages_To_Check := Packages_To_Check_By_Sync; when Pretty =>
when Elim => Tool_Package_Name := Name_Pretty_Printer;
Tool_Package_Name := Name_Eliminate; Packages_To_Check := Packages_To_Check_By_Pretty;
Packages_To_Check := Packages_To_Check_By_Eliminate; when Stack =>
when Find => Tool_Package_Name := Name_Stack;
Tool_Package_Name := Name_Finder; Packages_To_Check := Packages_To_Check_By_Stack;
Packages_To_Check := Packages_To_Check_By_Finder; when Stub =>
when Link => Tool_Package_Name := Name_Gnatstub;
Tool_Package_Name := Name_Linker; Packages_To_Check := Packages_To_Check_By_Gnatstub;
Packages_To_Check := Packages_To_Check_By_Linker; when Sync =>
when List => Tool_Package_Name := Name_Synchronize;
Tool_Package_Name := Name_Gnatls; Packages_To_Check := Packages_To_Check_By_Sync;
Packages_To_Check := Packages_To_Check_By_Gnatls; when Xref =>
when Metric => Tool_Package_Name := Name_Cross_Reference;
Tool_Package_Name := Name_Metrics; Packages_To_Check := Packages_To_Check_By_Xref;
Packages_To_Check := Packages_To_Check_By_Metric; when others =>
when Pretty => Tool_Package_Name := No_Name;
Tool_Package_Name := Name_Pretty_Printer; end case;
Packages_To_Check := Packages_To_Check_By_Pretty;
when Stack => if Tool_Package_Name /= No_Name then
Tool_Package_Name := Name_Stack;
Packages_To_Check := Packages_To_Check_By_Stack;
when Stub =>
Tool_Package_Name := Name_Gnatstub;
Packages_To_Check := Packages_To_Check_By_Gnatstub;
when Xref =>
Tool_Package_Name := Name_Cross_Reference;
Packages_To_Check := Packages_To_Check_By_Xref;
when others =>
null;
end case;
-- Check that the switches are consistent. Detect project file -- Check that the switches are consistent. Detect project file
-- related switches. -- related switches.
Inspect_Switches : Inspect_Switches : declare
declare
Arg_Num : Positive := 1; Arg_Num : Positive := 1;
Argv : String_Access; Argv : String_Access;
...@@ -1909,29 +1896,72 @@ begin ...@@ -1909,29 +1896,72 @@ begin
Element : Package_Element; Element : Package_Element;
Default_Switches_Array : Array_Element_Id; Switches_Array : Array_Element_Id;
The_Switches : Prj.Variable_Value; The_Switches : Prj.Variable_Value;
Current : Prj.String_List_Id; Current : Prj.String_List_Id;
The_String : String_Element; The_String : String_Element;
Main : String_Access := null;
Main_Id : Name_Id;
begin begin
if Pkg /= No_Package then if Pkg /= No_Package then
-- First, check if there is a single main specified.
for J in 1 .. Last_Switches.Last loop
if Last_Switches.Table (J) (1) /= '-' then
if Main = null then
Main := Last_Switches.Table (J);
else
Main := null;
exit;
end if;
end if;
end loop;
Element := Project_Tree.Packages.Table (Pkg); Element := Project_Tree.Packages.Table (Pkg);
Default_Switches_Array := -- If there is a single main and there is compilation
Prj.Util.Value_Of -- switches specified in the project file, use them.
(Name => Name_Default_Switches,
In_Arrays => Element.Decl.Arrays, if Main /= null and then not All_Projects then
In_Tree => Project_Tree); Name_Len := Main'Length;
The_Switches := Prj.Util.Value_Of Name_Buffer (1 .. Name_Len) := Main.all;
(Index => Name_Ada, Canonical_Case_File_Name (Name_Buffer (1 .. Name_Len));
Src_Index => 0, Main_Id := Name_Find;
In_Array => Default_Switches_Array,
In_Tree => Project_Tree); Switches_Array :=
Prj.Util.Value_Of
-- If there are switches specified in the package of the (Name => Name_Switches,
-- project file corresponding to the tool, scan them. In_Arrays => Element.Decl.Arrays,
In_Tree => Project_Tree);
The_Switches := Prj.Util.Value_Of
(Index => Main_Id,
Src_Index => 0,
In_Array => Switches_Array,
In_Tree => Project_Tree);
end if;
-- Otherwise, get the Default_Switches ("Ada")
if The_Switches.Kind = Undefined then
Switches_Array :=
Prj.Util.Value_Of
(Name => Name_Default_Switches,
In_Arrays => Element.Decl.Arrays,
In_Tree => Project_Tree);
The_Switches := Prj.Util.Value_Of
(Index => Name_Ada,
Src_Index => 0,
In_Array => Switches_Array,
In_Tree => Project_Tree);
end if;
-- If there are switches specified, put them in the
-- Carg_Switches table.
case The_Switches.Kind is case The_Switches.Kind is
when Prj.Undefined => when Prj.Undefined =>
......
...@@ -1747,6 +1747,8 @@ package body Sem_Ch10 is ...@@ -1747,6 +1747,8 @@ package body Sem_Ch10 is
Error_Node => N); Error_Node => N);
-- Give message if we did not get the unit -- Give message if we did not get the unit
-- Emit warning even if missing subunit is not
-- within main unit, to simplify debugging.
if Original_Operating_Mode = Generate_Code if Original_Operating_Mode = Generate_Code
and then Unum = No_Unit and then Unum = No_Unit
...@@ -1755,7 +1757,7 @@ package body Sem_Ch10 is ...@@ -1755,7 +1757,7 @@ package body Sem_Ch10 is
Error_Msg_File_1 := Error_Msg_File_1 :=
Get_File_Name (Subunit_Name, Subunit => True); Get_File_Name (Subunit_Name, Subunit => True);
Error_Msg_N Error_Msg_N
("subunit$$ in file{ not found?", N); ("subunit$$ in file{ not found?!!", N);
Subunits_Missing := True; Subunits_Missing := True;
end if; end if;
......
...@@ -3966,7 +3966,7 @@ package body Sem_Warn is ...@@ -3966,7 +3966,7 @@ package body Sem_Warn is
if Ekind (E) = E_In_Parameter if Ekind (E) = E_In_Parameter
or else not Referenced_As_LHS_Check_Spec (E) or else not Referenced_As_LHS_Check_Spec (E)
or else Is_Scalar_Type (E) or else Is_Scalar_Type (Etype (E))
then then
if Present (Body_E) then if Present (Body_E) then
E := Body_E; E := Body_E;
......
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