Commit d175a2fa by Arnaud Charlet

[multiple changes]

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

	* sem_ch10.adb (Install_Context): If the unit is a package body,
	install the private with_clauses of the corresponding package
	declaration.

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

	* checks.adb: Minor reformatting

2009-07-09  Vasiliy Fofanov  <fofanov@adacore.com>

	* ug_words, gnat_ugn.texi: Move VMS equivalents of the last check in
	into ug_words.

2009-07-09  Thomas Quinot  <quinot@adacore.com>

	* sem_ch13.adb (Analyze_Attribute_Definition_Clause, case Address):
	Do not warn for a constant overlaying any constant object

From-SVN: r149417
parent 24da37f2
...@@ -485,15 +485,14 @@ package body Checks is ...@@ -485,15 +485,14 @@ package body Checks is
if Inside_A_Generic then if Inside_A_Generic then
return; return;
-- Only apply the run-time check if the access parameter -- Only apply the run-time check if the access parameter has an
-- has an associated extra access level parameter and -- associated extra access level parameter and when the level of the
-- when the level of the type is less deep than the level -- type is less deep than the level of the access parameter, and
-- of the access parameter. -- accessibility checks are not suppressed.
elsif Present (Param_Ent) elsif Present (Param_Ent)
and then Present (Extra_Accessibility (Param_Ent)) and then Present (Extra_Accessibility (Param_Ent))
and then UI_Gt (Object_Access_Level (N), and then UI_Gt (Object_Access_Level (N), Type_Access_Level (Typ))
Type_Access_Level (Typ))
and then not Accessibility_Checks_Suppressed (Param_Ent) and then not Accessibility_Checks_Suppressed (Param_Ent)
and then not Accessibility_Checks_Suppressed (Typ) and then not Accessibility_Checks_Suppressed (Typ)
then then
......
...@@ -1733,49 +1733,47 @@ ada/exp_ch3.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \ ...@@ -1733,49 +1733,47 @@ ada/exp_ch3.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \
ada/nmake.adb ada/opt.ads ada/output.ads ada/restrict.ads \ ada/nmake.adb ada/opt.ads ada/output.ads ada/restrict.ads \
ada/restrict.adb ada/rident.ads ada/rtsfind.ads ada/sem.ads \ ada/restrict.adb ada/rident.ads ada/rtsfind.ads ada/sem.ads \
ada/sem_attr.ads ada/sem_aux.ads ada/sem_cat.ads ada/sem_ch3.ads \ ada/sem_attr.ads ada/sem_aux.ads ada/sem_cat.ads ada/sem_ch3.ads \
ada/sem_ch8.ads ada/sem_disp.ads ada/sem_eval.ads ada/sem_mech.ads \ ada/sem_ch6.ads ada/sem_ch8.ads ada/sem_disp.ads ada/sem_eval.ads \
ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads ada/sem_warn.ads \ ada/sem_mech.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/sem_warn.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
ada/sprint.ads ada/stand.ads ada/stringt.ads ada/system.ads \ ada/snames.ads ada/sprint.ads ada/stand.ads ada/stringt.ads \
ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads \ ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imenne.ads \
ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads ada/s-soflin.ads \ ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads \
ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \ ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \ ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \
ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \ ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads \
ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \ ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
ada/unchdeal.ads ada/urealp.ads ada/validsw.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/validsw.ads
ada/exp_ch4.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \ ada/exp_ch4.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 \
ada/casing.ads ada/checks.ads ada/checks.adb ada/csets.ads \ ada/casing.ads ada/checks.ads ada/checks.adb ada/debug.ads \
ada/debug.ads ada/einfo.ads ada/einfo.adb ada/elists.ads ada/elists.adb \ ada/einfo.ads ada/einfo.adb ada/elists.ads ada/elists.adb \
ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/eval_fat.ads \ ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/eval_fat.ads \
ada/exp_aggr.ads ada/exp_atag.ads ada/exp_ch11.ads ada/exp_ch2.ads \ ada/exp_aggr.ads ada/exp_atag.ads ada/exp_ch11.ads ada/exp_ch2.ads \
ada/exp_ch3.ads ada/exp_ch4.ads ada/exp_ch4.adb ada/exp_ch6.ads \ ada/exp_ch3.ads ada/exp_ch4.ads ada/exp_ch4.adb ada/exp_ch6.ads \
ada/exp_ch7.ads ada/exp_ch9.ads ada/exp_disp.ads ada/exp_dist.ads \ ada/exp_ch7.ads ada/exp_ch9.ads ada/exp_disp.ads ada/exp_fixd.ads \
ada/exp_fixd.ads ada/exp_pakd.ads ada/exp_tss.ads ada/exp_util.ads \ ada/exp_pakd.ads ada/exp_tss.ads ada/exp_util.ads ada/exp_util.adb \
ada/exp_util.adb ada/exp_vfpt.ads ada/fname.ads ada/fname-uf.ads \ ada/exp_vfpt.ads ada/fname.ads ada/fname-uf.ads ada/freeze.ads \
ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-htable.ads \ ada/get_targ.ads ada/gnat.ads ada/g-htable.ads ada/hostparm.ads \
ada/hostparm.ads ada/inline.ads ada/itypes.ads ada/lib.ads \ ada/inline.ads ada/itypes.ads ada/lib.ads ada/namet.ads ada/nlists.ads \
ada/lib-load.ads ada/namet.ads ada/nlists.ads ada/nlists.adb \ ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \
ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads ada/restrict.ads \ ada/restrict.ads ada/restrict.adb ada/rident.ads ada/rtsfind.ads \
ada/restrict.adb ada/rident.ads ada/rtsfind.ads ada/rtsfind.adb \
ada/sem.ads ada/sem_aux.ads ada/sem_cat.ads ada/sem_ch13.ads \ ada/sem.ads ada/sem_aux.ads ada/sem_cat.ads ada/sem_ch13.ads \
ada/sem_ch3.ads ada/sem_ch6.ads ada/sem_ch7.ads ada/sem_ch8.ads \ ada/sem_ch3.ads ada/sem_ch6.ads ada/sem_ch8.ads ada/sem_eval.ads \
ada/sem_dist.ads ada/sem_eval.ads ada/sem_eval.adb ada/sem_res.ads \ ada/sem_eval.adb ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads \
ada/sem_type.ads ada/sem_util.ads ada/sem_warn.ads ada/sinfo.ads \ ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/sprint.ads \ ada/snames.ads ada/sprint.ads ada/stand.ads ada/stringt.ads \
ada/stand.ads ada/stringt.ads ada/stringt.adb ada/system.ads \ ada/stringt.adb ada/system.ads ada/s-exctab.ads ada/s-exctab.adb \
ada/s-exctab.ads ada/s-exctab.adb ada/s-htable.ads ada/s-imenne.ads \ ada/s-htable.ads ada/s-imenne.ads ada/s-memory.ads ada/s-os_lib.ads \
ada/s-memory.ads ada/s-os_lib.ads ada/s-parame.ads ada/s-rident.ads \ ada/s-parame.ads ada/s-rident.ads ada/s-soflin.ads ada/s-stache.ads \
ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \ ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-string.ads \
ada/s-stoele.adb ada/s-string.ads ada/s-traent.ads ada/s-unstyp.ads \ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \ ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tbuild.adb \
ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads \ ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \
ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \ ada/uintp.adb ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \
ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/urealp.adb \ ada/urealp.ads ada/urealp.adb ada/validsw.ads
ada/validsw.ads
ada/exp_ch5.o : ada/ada.ads ada/a-except.ads ada/a-unccon.ads \ ada/exp_ch5.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 \
......
...@@ -6506,8 +6506,9 @@ following @command{gcc} switches refine this default behavior. ...@@ -6506,8 +6506,9 @@ following @command{gcc} switches refine this default behavior.
@cindex Suppressing checks @cindex Suppressing checks
@cindex Checks, suppressing @cindex Checks, suppressing
@findex Suppress @findex Suppress
Suppress all run-time checks as though @code{pragma Suppress (All_checks)} This switch causes the unit to be compiled
had been present in the source. Validity checks are also suppressed (in as though @code{pragma Suppress (All_checks)}
had been present in the source. Validity checks are also eliminated (in
other words @option{-gnatp} also implies @option{-gnatVn}. other words @option{-gnatp} also implies @option{-gnatVn}.
Use this switch to improve the performance Use this switch to improve the performance
of the code at the expense of safety in the presence of invalid data or of the code at the expense of safety in the presence of invalid data or
...@@ -6519,7 +6520,9 @@ checking code is zero or near-zero, the compiler will generate it even ...@@ -6519,7 +6520,9 @@ checking code is zero or near-zero, the compiler will generate it even
if checks are suppressed. In particular, if the compiler can prove if checks are suppressed. In particular, if the compiler can prove
that a certain check will necessarily fail, it will generate code to that a certain check will necessarily fail, it will generate code to
do an unconditional ``raise'', even if checks are suppressed. The do an unconditional ``raise'', even if checks are suppressed. The
compiler warns in this case. compiler warns in this case. Another case in which checks may not be
eliminated is when they are embedded in certain run time routines such
as math library routines.
Of course, run-time checks are omitted whenever the compiler can prove Of course, run-time checks are omitted whenever the compiler can prove
that they will not fail, whether or not checks are suppressed. that they will not fail, whether or not checks are suppressed.
...@@ -6996,7 +6999,7 @@ This not normally required, but is used by separate analysis tools. ...@@ -6996,7 +6999,7 @@ This not normally required, but is used by separate analysis tools.
Typically Typically
these tools do the necessary compilations automatically, so you should these tools do the necessary compilations automatically, so you should
not have to specify this switch in normal operation. not have to specify this switch in normal operation.
Note that the combination of switches @option{^-gnatct^/NOLOAD /TREE_OUTPUT^} Note that the combination of switches @option{-gnatct}
generates a tree in the form required by ASIS applications. generates a tree in the form required by ASIS applications.
@item -gnatu @item -gnatu
...@@ -20825,7 +20828,7 @@ structure and semantics as the @code{string_LITERAL} parameter of GNAT pragma ...@@ -20825,7 +20828,7 @@ structure and semantics as the @code{string_LITERAL} parameter of GNAT pragma
@pxref{Pragma Style_Checks,,, gnat_rm, GNAT Reference Manual}). For example, @pxref{Pragma Style_Checks,,, gnat_rm, GNAT Reference Manual}). For example,
@code{+RStyle_Checks:O} rule option activates and adds to @command{gnatcheck} @code{+RStyle_Checks:O} rule option activates and adds to @command{gnatcheck}
output the compiler style check that corresponds to output the compiler style check that corresponds to
@code{^-gnatyO^/STYLE_CHECKS=OVERRIDING_INDICATORS^} 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 rule
...@@ -3195,7 +3195,7 @@ package body Sem_Ch10 is ...@@ -3195,7 +3195,7 @@ package body Sem_Ch10 is
end if; end if;
-- If the unit is a body, the context of the specification must also -- If the unit is a body, the context of the specification must also
-- be installed. -- be installed. That includes private with_clauses in that context.
if Nkind (Lib_Unit) = N_Package_Body if Nkind (Lib_Unit) = N_Package_Body
or else (Nkind (Lib_Unit) = N_Subprogram_Body or else (Nkind (Lib_Unit) = N_Subprogram_Body
...@@ -3203,6 +3203,15 @@ package body Sem_Ch10 is ...@@ -3203,6 +3203,15 @@ package body Sem_Ch10 is
then then
Install_Context (Library_Unit (N)); Install_Context (Library_Unit (N));
-- Only install private with-clauses of a spec that comes from
-- source, excluding specs created for a subprogram body that is
-- a child unit.
if Comes_From_Source (Library_Unit (N)) then
Install_Private_With_Clauses
(Defining_Entity (Unit (Library_Unit (N))));
end if;
if Is_Child_Spec (Unit (Library_Unit (N))) then if Is_Child_Spec (Unit (Library_Unit (N))) then
-- If the unit is the body of a public child unit, the private -- If the unit is the body of a public child unit, the private
......
...@@ -936,7 +936,7 @@ package body Sem_Ch13 is ...@@ -936,7 +936,7 @@ package body Sem_Ch13 is
elsif Present (Aent) elsif Present (Aent)
and then Ekind (U_Ent) = E_Constant and then Ekind (U_Ent) = E_Constant
and then Ekind (Aent) /= E_Constant and then not Is_Constant_Object (Aent)
then then
Error_Msg_N ("constant overlays a variable?", Expr); Error_Msg_N ("constant overlays a variable?", Expr);
......
...@@ -54,6 +54,7 @@ gcc -c ^ GNAT COMPILE ...@@ -54,6 +54,7 @@ gcc -c ^ GNAT COMPILE
-gnatb ^ /REPORT_ERRORS=BRIEF -gnatb ^ /REPORT_ERRORS=BRIEF
-gnatB ^ /ASSUME_VALID -gnatB ^ /ASSUME_VALID
-gnatc ^ /NOLOAD -gnatc ^ /NOLOAD
-gnatct ^ /NOLOAD /TREE_OUTPUT
-gnatdc ^ /TRACE_UNITS -gnatdc ^ /TRACE_UNITS
-gnatdO ^ /REPORT_ERRORS=IMMEDIATE -gnatdO ^ /REPORT_ERRORS=IMMEDIATE
-gnatC ^ /COMPRESS_NAMES -gnatC ^ /COMPRESS_NAMES
...@@ -182,6 +183,7 @@ gcc -c ^ GNAT COMPILE ...@@ -182,6 +183,7 @@ gcc -c ^ GNAT COMPILE
-gnatW8 ^ /WIDE_CHARACTER_ENCODING=UTF8 -gnatW8 ^ /WIDE_CHARACTER_ENCODING=UTF8
-gnatW? ^ /WIDE_CHARACTER_ENCODING=? -gnatW? ^ /WIDE_CHARACTER_ENCODING=?
-gnaty ^ /STYLE_CHECKS -gnaty ^ /STYLE_CHECKS
-gnatyO ^ /STYLE_CHECKS=OVERRIDING_INDICATORS
-gnatyy ^ /STYLE_CHECKS=ALL_BUILTIN -gnatyy ^ /STYLE_CHECKS=ALL_BUILTIN
-gnatZ ^ /ZERO_COST_EXCEPTIONS -gnatZ ^ /ZERO_COST_EXCEPTIONS
-gnatzc ^ /DISTRIBUTION_STUBS=CALLER -gnatzc ^ /DISTRIBUTION_STUBS=CALLER
......
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