Bug 16704 - Letter F not understood as a radix-16 digit in READ statement.
Summary: Letter F not understood as a radix-16 digit in READ statement.
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libfortran (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: 4.0.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-25 10:49 UTC by Victor Leikehman
Modified: 2004-08-05 15:47 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2004-07-25 18:08:33


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Victor Leikehman 2004-07-25 10:49:53 UTC
Letters A-E are understood as base-16 digits, but not F or f.

program main
  character*2 buf
  buf = 'ff'
  read (buf, '(Z2.2)'), i
  if (i.ne.255) call abort
end

% a.out
Fortran runtime error: Bad value during integer read


FIX FOLLOWS:
[lei@roadrunner io]% cvs diff -cp read.c
Index: read.c
===================================================================
RCS file: /cvsroot/gcc/gcc/libgfortran/io/read.c,v
retrieving revision 1.2
diff -c -p -r1.2 read.c
*** read.c      13 May 2004 06:41:02 -0000      1.2
--- read.c      25 Jul 2004 10:47:13 -0000
*************** read_radix (fnode * f, char *dest, int l
*** 526,531 ****
--- 526,532 ----
            case 'c':
            case 'd':
            case 'e':
+             case 'f':
              c = c - 'a' + '9' + 1;
              break;
  
*************** read_radix (fnode * f, char *dest, int l
*** 534,539 ****
--- 535,541 ----
            case 'C':
            case 'D':
            case 'E':
+             case 'F':
              c = c - 'A' + '9' + 1;
              break;
Comment 1 Andrew Pinski 2004-07-25 18:08:33 UTC
Confirmed.
Comment 2 GCC Commits 2004-08-05 08:37:49 UTC
Subject: Bug 16704

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	steven@gcc.gnu.org	2004-08-05 08:37:43

Modified files:
	libgfortran    : ChangeLog 
	libgfortran/io : read.c 

Log message:
	Commit for Victor Leikehman  <lei@il.ibm.com>
	
	PR libgfortran/16704
	* io/read.c (read_radix): Understand letters f and F as hex digits.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/ChangeLog.diff?cvsroot=gcc&r1=1.54&r2=1.55
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libgfortran/io/read.c.diff?cvsroot=gcc&r1=1.2&r2=1.3

Comment 3 Andrew Pinski 2004-08-05 15:47:26 UTC
Fixed.