public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/39171]  New: Misleading warning for negative character length
@ 2009-02-12 18:19 domob at gcc dot gnu dot org
  2009-02-13 10:34 ` [Bug fortran/39171] " burnus at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: domob at gcc dot gnu dot org @ 2009-02-12 18:19 UTC (permalink / raw)
  To: gcc-bugs

When compiling code with a zero character-length like this:

character(len=0) :: str
end

gfortran gives no error/warning.  But for a negative length:

character(len=-1) :: str
end

one gets the misleading message:

character(len=-1) :: str
              1
Warning: CHARACTER variable has zero length at (1)

The correct behaviour is to adjust the negative length to zero; zero itself is
fine.  Dominique suggested to print this warning instead:

Warning: CHARACTER variable xxx has a negative length,
the length has been set to zero

And instead of always printing this warning, one could make it dependend on
some -W flag.


-- 
           Summary: Misleading warning for negative character length
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: domob at gcc dot gnu dot org


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


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

end of thread, other threads:[~2010-02-23 16:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-12 18:19 [Bug fortran/39171] New: Misleading warning for negative character length domob at gcc dot gnu dot org
2009-02-13 10:34 ` [Bug fortran/39171] " burnus at gcc dot gnu dot org
2009-02-19  5:56 ` pault at gcc dot gnu dot org
2009-12-27  9:35 ` domob at gcc dot gnu dot org
2010-02-09 10:44 ` domob at gcc dot gnu dot org
2010-02-09 10:45 ` domob at gcc dot gnu dot org
2010-02-23 16:39 ` hjl dot tools at gmail dot com

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).