public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/45129] I/O edit descriptors: Warn if the format field is too small for the E and F edit descriptor
       [not found] <bug-45129-4@http.gcc.gnu.org/bugzilla/>
@ 2010-11-16 14:52 ` burnus at gcc dot gnu.org
  2011-01-17 21:14 ` jvdelisle at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: burnus at gcc dot gnu.org @ 2010-11-16 14:52 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45129

--- Comment #4 from Tobias Burnus <burnus at gcc dot gnu.org> 2010-11-16 14:44:56 UTC ---
The question is whether the warning should be only printed if the problem
definitely occurs or only if it likely

  WRITE (*,'(f12.10)') 1.e0 ! prints 1.0000000000
  WRITE (*,'(f12.10)') 1.e1 ! prints ************

In this case, ifort prints with "-stand f03":
  The field width is too small for the number of fractional digits.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug fortran/45129] I/O edit descriptors: Warn if the format field is too small for the E and F edit descriptor
       [not found] <bug-45129-4@http.gcc.gnu.org/bugzilla/>
  2010-11-16 14:52 ` [Bug fortran/45129] I/O edit descriptors: Warn if the format field is too small for the E and F edit descriptor burnus at gcc dot gnu.org
@ 2011-01-17 21:14 ` jvdelisle at gcc dot gnu.org
  2011-06-15  8:55 ` burnus at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: jvdelisle at gcc dot gnu.org @ 2011-01-17 21:14 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45129

Jerry DeLisle <jvdelisle at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|unassigned at gcc dot       |jvdelisle at gcc dot
                   |gnu.org                     |gnu.org

--- Comment #5 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> 2011-01-17 20:09:05 UTC ---
Adding to my list


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug fortran/45129] I/O edit descriptors: Warn if the format field is too small for the E and F edit descriptor
       [not found] <bug-45129-4@http.gcc.gnu.org/bugzilla/>
  2010-11-16 14:52 ` [Bug fortran/45129] I/O edit descriptors: Warn if the format field is too small for the E and F edit descriptor burnus at gcc dot gnu.org
  2011-01-17 21:14 ` jvdelisle at gcc dot gnu.org
@ 2011-06-15  8:55 ` burnus at gcc dot gnu.org
  2013-02-15  7:38 ` burnus at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: burnus at gcc dot gnu.org @ 2011-06-15  8:55 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45129

--- Comment #6 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-06-15 08:55:00 UTC ---
(In reply to comment #4)
> The question is whether the warning should be only printed if the problem
> definitely occurs or only if it likely
[...]
> In this case, ifort prints with "-stand f03":
>   The field width is too small for the number of fractional digits.

ifort 12.0 changed the warning to a remark (printed by default):

remark #8291: Recommended relationship between field width 'W' and the number
of fractional digits 'D' in this edit descriptor is 'W>=D+7'.
 1000    FORMAT(e10.4)

remark #8290: Recommended relationship between field width 'W' and the number
of fractional digits 'D' in this edit descriptor is 'W>=D+3'.
22 Format (F2.2)


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug fortran/45129] I/O edit descriptors: Warn if the format field is too small for the E and F edit descriptor
       [not found] <bug-45129-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2011-06-15  8:55 ` burnus at gcc dot gnu.org
@ 2013-02-15  7:38 ` burnus at gcc dot gnu.org
  2014-03-30 18:09 ` dominiq at lps dot ens.fr
  2023-10-13 20:30 ` jvdelisle at gcc dot gnu.org
  5 siblings, 0 replies; 10+ messages in thread
From: burnus at gcc dot gnu.org @ 2013-02-15  7:38 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45129

Tobias Burnus <burnus at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |burnus at gcc dot gnu.org

--- Comment #7 from Tobias Burnus <burnus at gcc dot gnu.org> 2013-02-15 07:38:15 UTC ---
See also: PR 50105, where
     PROGRAM MAIN
       PRINT '(G6.5)', 1.0
     END
is invalid. Thus, that one should be diagnosed as well.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug fortran/45129] I/O edit descriptors: Warn if the format field is too small for the E and F edit descriptor
       [not found] <bug-45129-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2013-02-15  7:38 ` burnus at gcc dot gnu.org
@ 2014-03-30 18:09 ` dominiq at lps dot ens.fr
  2023-10-13 20:30 ` jvdelisle at gcc dot gnu.org
  5 siblings, 0 replies; 10+ messages in thread
From: dominiq at lps dot ens.fr @ 2014-03-30 18:09 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45129

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |NEW


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug fortran/45129] I/O edit descriptors: Warn if the format field is too small for the E and F edit descriptor
       [not found] <bug-45129-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2014-03-30 18:09 ` dominiq at lps dot ens.fr
@ 2023-10-13 20:30 ` jvdelisle at gcc dot gnu.org
  5 siblings, 0 replies; 10+ messages in thread
From: jvdelisle at gcc dot gnu.org @ 2023-10-13 20:30 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=45129

Jerry DeLisle <jvdelisle at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |jvdelisle at gcc dot gnu.org
                 CC|                            |jvdelisle at gcc dot gnu.org

--- Comment #8 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
Taking this one.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug fortran/45129] I/O edit descriptors: Warn if the format field is too small for the E and F edit descriptor
  2010-07-29 13:52 [Bug fortran/45129] New: " burnus at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2010-07-29 21:07 ` burnus at gcc dot gnu dot org
@ 2010-07-30  1:56 ` jvdelisle at gcc dot gnu dot org
  3 siblings, 0 replies; 10+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2010-07-30  1:56 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jvdelisle at gcc dot gnu dot org  2010-07-30 01:55 -------
I see this as an enhancement.


-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |enhancement


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45129


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug fortran/45129] I/O edit descriptors: Warn if the format field is too small for the E and F edit descriptor
  2010-07-29 13:52 [Bug fortran/45129] New: " burnus at gcc dot gnu dot org
  2010-07-29 17:25 ` [Bug fortran/45129] " domob at gcc dot gnu dot org
  2010-07-29 19:33 ` burnus at gcc dot gnu dot org
@ 2010-07-29 21:07 ` burnus at gcc dot gnu dot org
  2010-07-30  1:56 ` jvdelisle at gcc dot gnu dot org
  3 siblings, 0 replies; 10+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-07-29 21:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from burnus at gcc dot gnu dot org  2010-07-29 21:07 -------
For completeness, the current patch has failures for for following test cases.
In particular:

- Reading - here, the d == 0 does not harm (e.g. fmt_bz_bn.f).
- FMT_G: Here, the the width check is wrong (e.g. transpose_reshape_r10.f90)
- For writing, for 1P it might be zero, cf. fmt_zero_digits.f90

Thus, the simple check does not make much sense. Probably, one should just
remove it and leave only warning part in - with a fix for Gw.d? For read, more
is possible - but I think the fields are small enough that one could still warn
- or should one restrict the warning to WRITE/PRINT - and not include
READ/FORMAT?

gfortran.dg/fmt_bz_bn.f
gfortran.dg/fmt_read_bz_bn.f90
gfortran.dg/fmt_zero_digits.f90
gfortran.dg/fmt_zero_precision.f90
gfortran.dg/io_constraints_4.f90
gfortran.dg/past_eor.f90
gfortran.dg/read_infnan_1.f90
gfortran.dg/transpose_reshape_r10.f90


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45129


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug fortran/45129] I/O edit descriptors: Warn if the format field is too small for the E and F edit descriptor
  2010-07-29 13:52 [Bug fortran/45129] New: " burnus at gcc dot gnu dot org
  2010-07-29 17:25 ` [Bug fortran/45129] " domob at gcc dot gnu dot org
@ 2010-07-29 19:33 ` burnus at gcc dot gnu dot org
  2010-07-29 21:07 ` burnus at gcc dot gnu dot org
  2010-07-30  1:56 ` jvdelisle at gcc dot gnu dot org
  3 siblings, 0 replies; 10+ messages in thread
From: burnus at gcc dot gnu dot org @ 2010-07-29 19:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from burnus at gcc dot gnu dot org  2010-07-29 19:33 -------
Created an attachment (id=21355)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21355&action=view)
Draft patch

Jerry, what do you think?

Note: The smallest width is actually 3 also for D and E: That's enough to fit
INF or NAN - but the smallest useful width is slightly larger - and tested for.

I also added a check for the E* and D edit descriptor that "d" is positive; it
is not explicitly written in the standard, but it does not make sense to allow
0. ifort is strictly standard conform - and prints always '****' while NAG and
gfortran always give a run time error. Thus, I think it is sensible to check
whether d is positive - and print an error otherwise. (Again with "d == 0" one
could fit a NAN and INF in there, thus, strictly speaking one should allow it -
but I maintain that no sensible user will ever need this - and gfortran lacks
the run-time support for it.)


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45129


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug fortran/45129] I/O edit descriptors: Warn if the format field is too small for the E and F edit descriptor
  2010-07-29 13:52 [Bug fortran/45129] New: " burnus at gcc dot gnu dot org
@ 2010-07-29 17:25 ` domob at gcc dot gnu dot org
  2010-07-29 19:33 ` burnus at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 10+ messages in thread
From: domob at gcc dot gnu dot org @ 2010-07-29 17:25 UTC (permalink / raw)
  To: gcc-bugs



-- 

domob at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |domob at gcc dot gnu dot org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-07-29 17:25:15
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45129


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2023-10-13 20:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-45129-4@http.gcc.gnu.org/bugzilla/>
2010-11-16 14:52 ` [Bug fortran/45129] I/O edit descriptors: Warn if the format field is too small for the E and F edit descriptor burnus at gcc dot gnu.org
2011-01-17 21:14 ` jvdelisle at gcc dot gnu.org
2011-06-15  8:55 ` burnus at gcc dot gnu.org
2013-02-15  7:38 ` burnus at gcc dot gnu.org
2014-03-30 18:09 ` dominiq at lps dot ens.fr
2023-10-13 20:30 ` jvdelisle at gcc dot gnu.org
2010-07-29 13:52 [Bug fortran/45129] New: " burnus at gcc dot gnu dot org
2010-07-29 17:25 ` [Bug fortran/45129] " domob at gcc dot gnu dot org
2010-07-29 19:33 ` burnus at gcc dot gnu dot org
2010-07-29 21:07 ` burnus at gcc dot gnu dot org
2010-07-30  1:56 ` jvdelisle at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).