If this warning option is activated, then warnings are generated for
calls to subprograms marked with ``pragma Obsolescent`` and
for use of features in Annex J of the Ada Reference Manual. In the
- case of Annex J, not all features are flagged. In particular use
- of the renamed packages (like ``Text_IO``) and use of package
+ case of Annex J, not all features are flagged. In particular, uses of package
``ASCII`` are not flagged, since these are very common and
would generate many annoying positive warnings. The default is that
such warnings are not generated.
If this warning option is activated, then warnings are generated for
calls to subprograms marked with @code{pragma Obsolescent} and
for use of features in Annex J of the Ada Reference Manual. In the
-case of Annex J, not all features are flagged. In particular use
-of the renamed packages (like @code{Text_IO}) and use of package
+case of Annex J, not all features are flagged. In particular, uses of package
@code{ASCII} are not flagged, since these are very common and
would generate many annoying positive warnings. The default is that
such warnings are not generated.
-- Note: this is not quite right if the user defines one of these units
-- himself, but that's a marginal case, and fixing it is hard ???
- if Restriction_Check_Required (No_Obsolescent_Features) then
- if In_Predefined_Renaming (U) then
+ if Ada_Version >= Ada_95
+ and then In_Predefined_Renaming (U)
+ then
+ if Restriction_Check_Required (No_Obsolescent_Features) then
Check_Restriction (No_Obsolescent_Features, N);
Restriction_Violation := True;
end if;
+
+ if Warn_On_Obsolescent_Feature then
+ Error_Msg_N
+ ("renamed predefined unit is an obsolescent feature "
+ & "(RM J.1)?j?", N);
+ end if;
end if;
-- Check No_Implementation_Units violation
-- { dg-do compile}
-- { dg-options "-gnatwa" }
-with Text_IO;
-use Text_IO;
+with Ada.Text_IO;
+use Ada.Text_IO;
package body renaming1 is
- procedure Fo (A : Text_IO.File_Access) is
+ procedure Fo (A : Ada.Text_IO.File_Access) is
begin
- if A = Text_IO.Standard_Output then
+ if A = Ada.Text_IO.Standard_Output then
null;
end if;
end Fo;
-with Text_IO;
+with Ada.Text_IO;
package renaming1 is
- procedure Fo (A : Text_IO.File_Access);
+ procedure Fo (A : Ada.Text_IO.File_Access);
end;
-- { dg-do compile }
-- { dg-options "-gnatwa" }
-with Text_IO; use Text_IO;
+with Ada.Text_IO; use Ada.Text_IO;
package body Warn29 is
procedure P (X : T; Y : Integer) is