Bug 32545 - Give an (compile time) error not a warning for wrong edit format statements
Summary: Give an (compile time) error not a warning for wrong edit format statements
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.3.0
: P3 normal
Target Milestone: 4.3.0
Assignee: Jerry DeLisle
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-06-29 10:05 UTC by Tobias Burnus
Modified: 2007-07-04 01:16 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2007-06-29 20:05:54


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tobias Burnus 2007-06-29 10:05:21 UTC
Example:

read '(i0)', i
             1
Warning: Positive width required in format string at (1)

[2007-06-24 23:19:31] <jerryd> I would use gfc_notify_std instead of gfc_error at line 849 of io.c

Turning gfc_warning into gfc_error did not work as it should. We need to do some investagation why it does not and then trun it into gfc_notify_std.
Comment 1 Tobias Burnus 2007-06-29 16:00:44 UTC
Note: The test cases should then be updated as well.
(Though dg-error and dg-warning are treated alike -> PR30612, PR29882.)
Comment 2 Jerry DeLisle 2007-06-29 20:05:54 UTC
Since I partly discovered this, I will see what I can do.
Comment 3 Jerry DeLisle 2007-06-29 23:23:43 UTC
Currently inline_1.f90 in gfortran.fortran-torture/compile is passing because the error in the print statement is only giving a warning.

Patch testing.
Comment 4 patchapp@dberlin.org 2007-07-04 00:39:59 UTC
Subject: Bug number PR32545

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2007-07/msg00303.html
Comment 5 Jerry DeLisle 2007-07-04 01:08:59 UTC
Subject: Bug 32545

Author: jvdelisle
Date: Wed Jul  4 01:08:48 2007
New Revision: 126295

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

	PR fortran/32545
	* io.c (check_format): Always call gfc_error for errors.
	(check_format_string): Change type of this function to try and
	return the result of check_format.
	(check_io_constraints): Return MATCH_ERROR if check_format_string
	returns FAILURE.

2007-07-03  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/32612
	* decl.c (get_proc_name): Include attr->mod_proc in check for error.

Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/decl.c
    trunk/gcc/fortran/io.c

Comment 6 Jerry DeLisle 2007-07-04 01:13:59 UTC
Subject: Bug 32545

Author: jvdelisle
Date: Wed Jul  4 01:13:47 2007
New Revision: 126296

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

	PR fortran/32545
	* gfortran.dg/fmt_error.f90: New test.

2007-07-03  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/32612
	* gfortran.dg/interface_13.f90: New test.

Added:
    trunk/gcc/testsuite/gfortran.dg/fmt_error.f90
    trunk/gcc/testsuite/gfortran.dg/interface_13.f90
Modified:
    trunk/gcc/testsuite/ChangeLog

Comment 7 Jerry DeLisle 2007-07-04 01:16:43 UTC
Fixed on trunk, closing