public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/31821]  New: character pointer => target(range) should detect if lengths don't match
@ 2007-05-04 19:11 burnus at gcc dot gnu dot org
  2007-05-04 19:43 ` [Bug fortran/31821] " jvdelisle at gcc dot gnu dot org
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-05-04 19:11 UTC (permalink / raw)
  To: gcc-bugs

character (len=4), s1
  character (len=20), pointer :: p1
  s1 = 'abcd'
  p1 => s1(2:3)

should be rejected at compile time as len(s1(2:3)) == 2 but p1 has the length
20.

This is not detected because primary.c's match_varspec contains:

        if (substring)
            primary->ts.cl = NULL;

If one removes this check, the proper error:
   Error: Different character lengths in pointer assignment at (1)
is shown. The solution is to resolve ts.cl->length for substrings if possible
and only set it to NULL if it is not known at compile time.


-- 
           Summary: character pointer => target(range) should detect if
                    lengths don't match
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


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


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

end of thread, other threads:[~2010-12-24  8:44 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-31821-4@http.gcc.gnu.org/bugzilla/>
2010-12-11  9:47 ` [Bug fortran/31821] character pointer => target(range) should detect if lengths don't match tkoenig at gcc dot gnu.org
2010-12-11 12:38 ` tkoenig at gcc dot gnu.org
2010-12-11 13:25 ` tkoenig at gcc dot gnu.org
2010-12-12 13:58 ` tkoenig at gcc dot gnu.org
2010-12-12 14:09 ` tkoenig at gcc dot gnu.org
2010-12-13 20:29 ` tkoenig at gcc dot gnu.org
2010-12-13 20:29 ` tkoenig at gcc dot gnu.org
2010-12-21 22:11 ` tkoenig at gcc dot gnu.org
2010-12-24  8:42 ` tkoenig at gcc dot gnu.org
2010-12-24  8:44 ` tkoenig at gcc dot gnu.org
2007-05-04 19:11 [Bug fortran/31821] New: " burnus at gcc dot gnu dot org
2007-05-04 19:43 ` [Bug fortran/31821] " jvdelisle at gcc dot gnu dot org
2007-05-04 21:14 ` burnus at gcc dot gnu dot org
2007-05-25  4:39 ` pault 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).