public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/31266]  New: Spurious(?) warning about character truncation
@ 2007-03-19 15:46 jellby at yahoo dot com
  2007-03-21 15:59 ` [Bug fortran/31266] " burnus at gcc dot gnu dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: jellby at yahoo dot com @ 2007-03-19 15:46 UTC (permalink / raw)
  To: gcc-bugs

When a component of a "custom" type is a character, taking a substring of it
triggers a warning about the variable being truncated (with -Wall). Maybe it is
not the correct syntax to get a substring out of a character component (still,
it works fine for printing, for example)?


$cat test.f90
PROGRAM test
  IMPLICIT NONE
  TYPE custom
    CHARACTER(LEN=10) :: nom
  END TYPE custom
  CHARACTER (LEN=10) :: a
  CHARACTER (LEN=2)  :: b
  TYPE(custom) :: c

  a='1234567890'
  b=a(1:2)
  c%nom=a
  b=c%nom(1:2)

END PROGRAM test

$gfortran -Wall -c test.f90
test1.f90:13.14:

  b=c%nom(1:2)
             1
Warning: rhs of CHARACTER assignment at (1) will be truncated (10/2)


-- 
           Summary: Spurious(?) warning about character truncation
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jellby at yahoo dot com


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


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

* [Bug fortran/31266] Spurious(?) warning about character truncation
  2007-03-19 15:46 [Bug fortran/31266] New: Spurious(?) warning about character truncation jellby at yahoo dot com
@ 2007-03-21 15:59 ` burnus at gcc dot gnu dot org
  2007-03-25 22:13 ` tobi at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-03-21 15:59 UTC (permalink / raw)
  To: gcc-bugs



-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |diagnostic
   Last reconfirmed|0000-00-00 00:00:00         |2007-03-21 15:59:31
               date|                            |


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


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

* [Bug fortran/31266] Spurious(?) warning about character truncation
  2007-03-19 15:46 [Bug fortran/31266] New: Spurious(?) warning about character truncation jellby at yahoo dot com
  2007-03-21 15:59 ` [Bug fortran/31266] " burnus at gcc dot gnu dot org
@ 2007-03-25 22:13 ` tobi at gcc dot gnu dot org
  2007-04-10 14:14 ` tobi at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: tobi at gcc dot gnu dot org @ 2007-03-25 22:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from tobi at gcc dot gnu dot org  2007-03-26 00:13 -------
It probably shouldn't say "rhs" in the error message, either.

It looks like we don't look through the references correctly when determining
the length of the rhs, though I can't see exactly where this goes wrong.


-- 


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


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

* [Bug fortran/31266] Spurious(?) warning about character truncation
  2007-03-19 15:46 [Bug fortran/31266] New: Spurious(?) warning about character truncation jellby at yahoo dot com
  2007-03-21 15:59 ` [Bug fortran/31266] " burnus at gcc dot gnu dot org
  2007-03-25 22:13 ` tobi at gcc dot gnu dot org
@ 2007-04-10 14:14 ` tobi at gcc dot gnu dot org
  2007-04-12 17:13 ` patchapp at dberlin dot org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: tobi at gcc dot gnu dot org @ 2007-04-10 14:14 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from tobi at gcc dot gnu dot org  2007-04-10 15:13 -------
I have a patch, but I want to fix the related PR30871 at the same time.


-- 

tobi at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |tobi at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2007-03-21 15:59:31         |2007-04-10 15:13:49
               date|                            |


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


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

* [Bug fortran/31266] Spurious(?) warning about character truncation
  2007-03-19 15:46 [Bug fortran/31266] New: Spurious(?) warning about character truncation jellby at yahoo dot com
                   ` (2 preceding siblings ...)
  2007-04-10 14:14 ` tobi at gcc dot gnu dot org
@ 2007-04-12 17:13 ` patchapp at dberlin dot org
  2007-04-12 18:10 ` tobi at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: patchapp at dberlin dot org @ 2007-04-12 17:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from patchapp at dberlin dot org  2007-04-12 18:13 -------
Subject: Bug number PR31266

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-04/msg00695.html


-- 


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


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

* [Bug fortran/31266] Spurious(?) warning about character truncation
  2007-03-19 15:46 [Bug fortran/31266] New: Spurious(?) warning about character truncation jellby at yahoo dot com
                   ` (3 preceding siblings ...)
  2007-04-12 17:13 ` patchapp at dberlin dot org
@ 2007-04-12 18:10 ` tobi at gcc dot gnu dot org
  2007-04-13 13:51 ` tobi at gcc dot gnu dot org
  2007-04-13 14:18 ` tobi at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: tobi at gcc dot gnu dot org @ 2007-04-12 18:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from tobi at gcc dot gnu dot org  2007-04-12 19:10 -------
Subject: Bug 31266

Author: tobi
Date: Thu Apr 12 19:10:10 2007
New Revision: 123759

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=123759
Log:
PR fortran/31266
fortran/
* primary.c (gfc_variable_attr): Don't copy string length if it
doesn't make sense.
* resolve.c (resolve_code): Clarify error message.
testsuite/
* gfortran.dg/char_assign_1.f90: New.


Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/primary.c
    trunk/gcc/fortran/resolve.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


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

* [Bug fortran/31266] Spurious(?) warning about character truncation
  2007-03-19 15:46 [Bug fortran/31266] New: Spurious(?) warning about character truncation jellby at yahoo dot com
                   ` (4 preceding siblings ...)
  2007-04-12 18:10 ` tobi at gcc dot gnu dot org
@ 2007-04-13 13:51 ` tobi at gcc dot gnu dot org
  2007-04-13 14:18 ` tobi at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: tobi at gcc dot gnu dot org @ 2007-04-13 13:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from tobi at gcc dot gnu dot org  2007-04-13 14:50 -------
Fixed.


-- 

tobi at gcc dot gnu dot org changed:

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


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


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

* [Bug fortran/31266] Spurious(?) warning about character truncation
  2007-03-19 15:46 [Bug fortran/31266] New: Spurious(?) warning about character truncation jellby at yahoo dot com
                   ` (5 preceding siblings ...)
  2007-04-13 13:51 ` tobi at gcc dot gnu dot org
@ 2007-04-13 14:18 ` tobi at gcc dot gnu dot org
  6 siblings, 0 replies; 8+ messages in thread
From: tobi at gcc dot gnu dot org @ 2007-04-13 14:18 UTC (permalink / raw)
  To: gcc-bugs



-- 

tobi at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.3.0


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


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

end of thread, other threads:[~2007-04-13 14:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-19 15:46 [Bug fortran/31266] New: Spurious(?) warning about character truncation jellby at yahoo dot com
2007-03-21 15:59 ` [Bug fortran/31266] " burnus at gcc dot gnu dot org
2007-03-25 22:13 ` tobi at gcc dot gnu dot org
2007-04-10 14:14 ` tobi at gcc dot gnu dot org
2007-04-12 17:13 ` patchapp at dberlin dot org
2007-04-12 18:10 ` tobi at gcc dot gnu dot org
2007-04-13 13:51 ` tobi at gcc dot gnu dot org
2007-04-13 14:18 ` tobi 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).