Bug 36094 - Runtime error show_locus not working correctly
Summary: Runtime error show_locus not working correctly
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libfortran (show other bugs)
Version: 4.4.0
: P3 normal
Target Milestone: ---
Assignee: Jerry DeLisle
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-01 03:04 UTC by Jerry DeLisle
Modified: 2008-05-02 16:50 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2008-05-01 03:05:12


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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