public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/33539]  New: Too much noise on zero-length character strings
@ 2007-09-23 21:39 anlauf at gmx dot de
  2007-10-01  0:08 ` [Bug fortran/33539] Too much noise for " fxcoudert at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: anlauf at gmx dot de @ 2007-09-23 21:39 UTC (permalink / raw)
  To: gcc-bugs

Hi,

gfortran is way too noisy for zero-length character strings.
I get:

% gfc gfcbug71.f90
gfcbug71.f90:3.44:

  character(len=*), parameter :: prefix = ""
                                           1
Warning: CHARACTER variable has zero length at (1)
gfcbug71.f90:7.14:

  use gfcbug71
             1
Warning: CHARACTER variable has zero length at (1)
% cat gfcbug71.f90
module gfcbug71
  implicit none
  character(len=*), parameter :: prefix = ""
end module gfcbug71

program test
  use gfcbug71
  implicit none
  print *, "prefix = ", prefix
end program test


The first warning is a nuisance, but the second one when USEing
the module is really annoying.  This should not be the default.


-- 
           Summary: Too much noise on zero-length character strings
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: anlauf at gmx dot de
  GCC host triplet: i686-pc-linux-gnu


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


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

* [Bug fortran/33539] Too much noise for zero-length character strings
  2007-09-23 21:39 [Bug fortran/33539] New: Too much noise on zero-length character strings anlauf at gmx dot de
@ 2007-10-01  0:08 ` fxcoudert at gcc dot gnu dot org
  2007-10-03 18:51 ` tkoenig at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-10-01  0:08 UTC (permalink / raw)
  To: gcc-bugs



-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |fxcoudert at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   GCC host triplet|i686-pc-linux-gnu           |
           Keywords|                            |diagnostic
   Last reconfirmed|0000-00-00 00:00:00         |2007-10-01 00:07:51
               date|                            |


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


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

* [Bug fortran/33539] Too much noise for zero-length character strings
  2007-09-23 21:39 [Bug fortran/33539] New: Too much noise on zero-length character strings anlauf at gmx dot de
  2007-10-01  0:08 ` [Bug fortran/33539] Too much noise for " fxcoudert at gcc dot gnu dot org
@ 2007-10-03 18:51 ` tkoenig at gcc dot gnu dot org
  2007-10-04 20:26 ` tkoenig at gcc dot gnu dot org
  2007-10-04 20:27 ` tkoenig at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2007-10-03 18:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from tkoenig at gcc dot gnu dot org  2007-10-03 18:51 -------
This may work:

$ svn diff
Index: resolve.c
===================================================================
--- resolve.c   (revision 128885)
+++ resolve.c   (working copy)
@@ -6563,7 +6563,7 @@ resolve_charlen (gfc_charlen *cl)

   /* "If the character length parameter value evaluates to a negative
      value, the length of character entities declared is zero."  */
-  if (cl->length && !gfc_extract_int (cl->length, &i) && i <= 0)
+  if (cl->length && !gfc_extract_int (cl->length, &i) && i < 0)
     {
       gfc_warning_now ("CHARACTER variable has zero length at %L",
                       &cl->length->where);

(I do want a warning for a length that's less than zero, but
exactly zero seems to be OK).


-- 

tkoenig at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tkoenig at gcc dot gnu dot
                   |                            |org
           Severity|normal                      |enhancement


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


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

* [Bug fortran/33539] Too much noise for zero-length character strings
  2007-09-23 21:39 [Bug fortran/33539] New: Too much noise on zero-length character strings anlauf at gmx dot de
  2007-10-01  0:08 ` [Bug fortran/33539] Too much noise for " fxcoudert at gcc dot gnu dot org
  2007-10-03 18:51 ` tkoenig at gcc dot gnu dot org
@ 2007-10-04 20:26 ` tkoenig at gcc dot gnu dot org
  2007-10-04 20:27 ` tkoenig at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2007-10-04 20:26 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from tkoenig at gcc dot gnu dot org  2007-10-04 20:26 -------
Subject: Bug 33539

Author: tkoenig
Date: Thu Oct  4 20:26:24 2007
New Revision: 129022

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=129022
Log:
2007-10-04  Thomas Koenig  <tkoenig@gcc.gnu.org>

        PR fortran/33539
        * resolve.c: Only warn if the string length is
        less than zero.

2007-10-04  Thomas Koenig  <tkoenig@gcc.gnu.org>

        PR fortran/33539
        * zero_length_2.f90:  Omit warning for zero-length string.
        * repeat_2.f90:  Likewise.
        * repeat_4.f90:  Likewise.
        * char_length_2.f90:  Likewise.


Modified:
    trunk/gcc/fortran/resolve.c
    trunk/gcc/testsuite/gfortran.dg/char_length_2.f90
    trunk/gcc/testsuite/gfortran.dg/repeat_2.f90
    trunk/gcc/testsuite/gfortran.dg/repeat_4.f90
    trunk/gcc/testsuite/gfortran.dg/zero_length_2.f90


-- 


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


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

* [Bug fortran/33539] Too much noise for zero-length character strings
  2007-09-23 21:39 [Bug fortran/33539] New: Too much noise on zero-length character strings anlauf at gmx dot de
                   ` (2 preceding siblings ...)
  2007-10-04 20:26 ` tkoenig at gcc dot gnu dot org
@ 2007-10-04 20:27 ` tkoenig at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: tkoenig at gcc dot gnu dot org @ 2007-10-04 20:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from tkoenig at gcc dot gnu dot org  2007-10-04 20:27 -------
Fixed on trunk.


-- 

tkoenig at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2007-10-04 20:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-23 21:39 [Bug fortran/33539] New: Too much noise on zero-length character strings anlauf at gmx dot de
2007-10-01  0:08 ` [Bug fortran/33539] Too much noise for " fxcoudert at gcc dot gnu dot org
2007-10-03 18:51 ` tkoenig at gcc dot gnu dot org
2007-10-04 20:26 ` tkoenig at gcc dot gnu dot org
2007-10-04 20:27 ` tkoenig 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).