Bug 36422 - Misleading error message for (a0) edit descriptor
Summary: Misleading error message for (a0) edit descriptor
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.4.0
: P3 normal
Target Milestone: ---
Assignee: Jerry DeLisle
URL:
Keywords: diagnostic
Depends on:
Blocks:
 
Reported: 2008-06-02 14:15 UTC by Tobias Burnus
Modified: 2008-06-08 00:31 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2008-06-03 18:30:29


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Burnus 2008-06-02 14:15:41 UTC
print '(a0)', ':'
                1
Error: Expected P edit descriptor in format string at (1)

Expected:
  Error: Positive width required in format string at (1)
Comment 1 Tobias Burnus 2008-06-02 14:16:58 UTC
Same for the run-time error message:

At line 2 of file aa.f90 (unit = 6, file = 'stdout')
Fortran runtime error: Expected P edit descriptor in format
Comment 2 Jerry DeLisle 2008-06-03 18:30:29 UTC
OK, I know what is going on here.
Comment 3 Jerry DeLisle 2008-06-08 00:00:40 UTC
Subject: Bug 36422

Author: jvdelisle
Date: Sat Jun  7 23:59:53 2008
New Revision: 136545

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

	PR libfortran/36420
	PR libfortran/36421
	PR libfortran/36422
	* io/io.h: Add prototype for write_real.
	* io/transfer.c (formatted_transfer_scalar): For FMT_G and width zero,
	use write_real.
	* io/format.c: Add zero width error message. (parse_format_list): Use
	error message for FMT_A if followed by FMT_ZERO. Use zero width error
	message	for FMT_G if mode is READ or if -std=f95 or f2003. (fmormat0):
	Fix typo in comment.
	* io/write.c (write_a): Set wlen to len if FMT_G and length is zero.
	(write_l): Add wlen variable and use it if FMT_G and width is zero.
	(write_decimal): If FMT_G, set m to -1 to flag processor dependent
	formatting. (write_real): Remove static declaration.

Modified:
    trunk/libgfortran/ChangeLog
    trunk/libgfortran/io/format.c
    trunk/libgfortran/io/io.h
    trunk/libgfortran/io/transfer.c
    trunk/libgfortran/io/write.c

Comment 4 Jerry DeLisle 2008-06-08 00:09:49 UTC
Subject: Bug 36422

Author: jvdelisle
Date: Sun Jun  8 00:09:01 2008
New Revision: 136547

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

	PR fortran/36420
	PR fortran/36421
	PR fortran/36422
	* gfortran.dg/fmt_g0_1.f08: New test.
	* gfortran.dg/fmt_g0_2.f08: New test.
	* gfortran.dg/fmt_g0_3.f08: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/fmt_g0_1.f08
    trunk/gcc/testsuite/gfortran.dg/fmt_g0_2.f08
    trunk/gcc/testsuite/gfortran.dg/fmt_g0_3.f08
Modified:
    trunk/gcc/testsuite/ChangeLog

Comment 5 Jerry DeLisle 2008-06-08 00:31:10 UTC
Fixed on trunk.