Bug 36094

Summary: Runtime error show_locus not working correctly
Product: gcc Reporter: Jerry DeLisle <jvdelisle2>
Component: libfortranAssignee: Jerry DeLisle <jvdelisle2>
Status: RESOLVED FIXED    
Severity: normal CC: gcc-bugs
Priority: P3    
Version: 4.4.0   
Target Milestone: ---   
Host: Target:
Build: Known to work:
Known to fail: Last reconfirmed: 2008-05-01 03:05:12

Description Jerry DeLisle 2008-05-01 03:04:53 UTC
show_locus is failing to show the error locus because for some reason filename_from_unit is returning a NULL string for this test case.

character(len=10) :: cc = 'bad'
open(99,file="dd",encoding=cc)
write(*,*) 'HELLO'
end
Comment 1 Jerry DeLisle 2008-05-01 04:40:03 UTC
The unit has not been opened yet when this error occurs so it does not exist in the unit list yet.  In this case we should just show the unit number.
Comment 2 Jerry DeLisle 2008-05-02 01:34:03 UTC
Subject: Bug 36094

Author: jvdelisle
Date: Fri May  2 01:33:16 2008
New Revision: 134876

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=134876
Log:
2008-05-01  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR libfortran/36094
	* runtime/error.c (show_locus): Provide modified error message when
	filename has not yet been associated with a unit number.
	* io/open.c (encoding_opt[]): Comment out "utf-8" option and add TODO.

Modified:
    trunk/libgfortran/ChangeLog
    trunk/libgfortran/io/open.c
    trunk/libgfortran/runtime/error.c

Comment 3 Jerry DeLisle 2008-05-02 16:50:37 UTC
Fixed