Commit acf6b7ab by Samuel Tardieu Committed by Samuel Tardieu

re PR ada/22255 (Reset on shared file causes Use_Error.)

    gcc/ada/
	PR ada/22255
	* s-fileio.adb (Reset): Do not raise Use_Error if mode isn't changed.

    gcc/testsuite/
	PR ada/22255
	* gnat.dg/test_direct_io.adb: New file.

From-SVN: r132708
parent f5c064ab
2008-02-27 Samuel Tardieu <sam@rfc1149.net> 2008-02-27 Samuel Tardieu <sam@rfc1149.net>
PR ada/22255
* s-fileio.adb (Reset): Do not raise Use_Error if mode isn't changed.
2008-02-27 Samuel Tardieu <sam@rfc1149.net>
PR ada/34799 PR ada/34799
* sem_ch13.adb (Analyze_Record_Representation_Clause): Check * sem_ch13.adb (Analyze_Record_Representation_Clause): Check
that underlying type is present. that underlying type is present.
...@@ -1074,13 +1074,15 @@ package body System.File_IO is ...@@ -1074,13 +1074,15 @@ package body System.File_IO is
begin begin
Check_File_Open (File); Check_File_Open (File);
-- Change of mode not allowed for shared file or file with no name -- Change of mode not allowed for shared file or file with no name or
-- or file that is not a regular file, or for a system file. -- file that is not a regular file, or for a system file. Note that we
-- allow the "change" of mode if it is not in fact doing a change.
if File.Shared_Status = Yes if Mode /= File.Mode
and then (File.Shared_Status = Yes
or else File.Name'Length <= 1 or else File.Name'Length <= 1
or else File.Is_System_File or else File.Is_System_File
or else not File.Is_Regular_File or else not File.Is_Regular_File)
then then
raise Use_Error; raise Use_Error;
......
2008-02-27 Samuel Tardieu <sam@rfc1149.net> 2008-02-27 Samuel Tardieu <sam@rfc1149.net>
PR ada/22255
* gnat.dg/test_direct_io.adb: New file.
2008-02-27 Samuel Tardieu <sam@rfc1149.net>
PR ada/34799 PR ada/34799
* gnat.dg/specs/pr34799.ads: New test. * gnat.dg/specs/pr34799.ads: New test.
-- { dg-do run }
with Ada.Direct_IO;
procedure Test_Direct_IO is
package BDIO is new Ada.Direct_IO (Boolean);
use BDIO;
FD : File_Type;
begin
Create (FD, Form => "shared=yes");
Reset (FD);
Close (FD);
end Test_Direct_IO;
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