Commit 4581ba9d by Francois-Xavier Coudert Committed by François-Xavier Coudert

re PR libfortran/19155 ([4.0 only] blanks not treated as zeros in 'E' format read (NIST FM110.FOR))

	PR libfortran/19155
	* io/read.c (read_f): Accept 'e', 'E', 'd' and 'D' as first
	non-blank characters of a real number.
	* gfortran.dg/pr19155.f: New test.

From-SVN: r99424
parent 4bbcb8fc
2005-05-09 Francois-Xavier Coudert <coudert@clipper.ens.fr>
PR libfortran/19155
* gfortran.dg/pr19155.f: New test.
2005-05-08 Roger Sayle <roger@eyesopen.com> 2005-05-08 Roger Sayle <roger@eyesopen.com>
PR inline-asm/8788 PR inline-asm/8788
......
! { dg-do run }
!
! PR libfortran/19155
! We accept 'E+00' as a valid real number. The standard says it is not,
! but doesn't require us to issue an error. Since g77 accepts this as zero,
! we do the same.
real a
a = 42
open (19,status='scratch')
write (19,'(A15)') 'E+00'
rewind (19)
read (19,'(E15.8)') a
if (a .ne. 0) call abort
close (19)
end
2005-05-09 Francois-Xavier Coudert <coudert@clipper.ens.fr>
PR libfortran/19155
* io/read.c (read_f): Accept 'e', 'E', 'd' and 'D' as first
non-blank characters of a real number.
2005-05-04 Thomas Koenig <Thomas.Koenig@online.de> 2005-05-04 Thomas Koenig <Thomas.Koenig@online.de>
PR libfortran/21354 PR libfortran/21354
......
...@@ -892,7 +892,7 @@ open_internal (char *base, int length) ...@@ -892,7 +892,7 @@ open_internal (char *base, int length)
* around it. */ * around it. */
static stream * static stream *
fd_to_stream (int fd, int prot) fd_to_stream (int fd, int prot, int avoid_mmap)
{ {
struct stat statbuf; struct stat statbuf;
unix_stream *s; unix_stream *s;
...@@ -911,7 +911,10 @@ fd_to_stream (int fd, int prot) ...@@ -911,7 +911,10 @@ fd_to_stream (int fd, int prot)
s->file_length = S_ISREG (statbuf.st_mode) ? statbuf.st_size : -1; s->file_length = S_ISREG (statbuf.st_mode) ? statbuf.st_size : -1;
#if HAVE_MMAP #if HAVE_MMAP
mmap_open (s); if (avoid_mmap)
fd_open (s);
else
mmap_open (s);
#else #else
fd_open (s); fd_open (s);
#endif #endif
...@@ -1153,7 +1156,7 @@ open_external (unit_flags *flags) ...@@ -1153,7 +1156,7 @@ open_external (unit_flags *flags)
internal_error ("open_external(): Bad action"); internal_error ("open_external(): Bad action");
} }
return fd_to_stream (fd, prot); return fd_to_stream (fd, prot, 0);
} }
...@@ -1163,7 +1166,7 @@ open_external (unit_flags *flags) ...@@ -1163,7 +1166,7 @@ open_external (unit_flags *flags)
stream * stream *
input_stream (void) input_stream (void)
{ {
return fd_to_stream (STDIN_FILENO, PROT_READ); return fd_to_stream (STDIN_FILENO, PROT_READ, 1);
} }
...@@ -1173,7 +1176,7 @@ input_stream (void) ...@@ -1173,7 +1176,7 @@ input_stream (void)
stream * stream *
output_stream (void) output_stream (void)
{ {
return fd_to_stream (STDOUT_FILENO, PROT_WRITE); return fd_to_stream (STDOUT_FILENO, PROT_WRITE, 1);
} }
...@@ -1183,7 +1186,7 @@ output_stream (void) ...@@ -1183,7 +1186,7 @@ output_stream (void)
stream * stream *
error_stream (void) error_stream (void)
{ {
return fd_to_stream (STDERR_FILENO, PROT_WRITE); return fd_to_stream (STDERR_FILENO, PROT_WRITE, 1);
} }
/* init_error_stream()-- Return a pointer to the error stream. This /* init_error_stream()-- Return a pointer to the error stream. This
......
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