public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "w6ws at earthlink dot net" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/36058]  New: Not allowing pointers to derived types in COMMON
Date: Sun, 27 Apr 2008 04:25:00 -0000	[thread overview]
Message-ID: <bug-36058-15045@http.gcc.gnu.org/bugzilla/> (raw)

Gfortran is not allowing pointers to certain derived types to reside in COMMON.
 While there are constraints for derived type objects themselves (ref section
5.5.2 of F2003), there do not appear to be constraints on pointers to them.  So
it seems that gfortran is not considering 'pointeredness' when applying the
constraint checks in 5.5.2.

$ cat commonptr.f90
subroutine commonptr ()
  implicit none

  type wws_t
    integer :: x = 1, y = 2, z = 3
  end type

  type (wws_t), pointer :: my_wwsptr
  common /block/ my_wwsptr

  allocate (my_wwsptr)
  my_wwsptr = wws_t (3, 4, 5)

end subroutine
$
$ gfortran --version
GNU Fortran (GCC) 4.3.0 20071222 (experimental) [trunk revision 127783]
Copyright (C) 2007 Free Software Foundation, Inc.

GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING

$ gfortran -c commonptr.f90
commonptr.f90:8.36:

  type (wws_t), pointer :: my_wwsptr
                                   1
Error: Derived type variable 'my_wwsptr' in COMMON at (1) has neither the
SEQUENCE nor the BIND(C) attribute
commonptr.f90:8.36:

  type (wws_t), pointer :: my_wwsptr
                                   1
Error: Derived type variable 'my_wwsptr' in COMMON at (1) may not have default
initializer
$


-- 
           Summary: Not allowing pointers to derived types in COMMON
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: w6ws at earthlink dot net


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


             reply	other threads:[~2008-04-27  4:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-27  4:25 w6ws at earthlink dot net [this message]
2008-04-27  8:01 ` [Bug fortran/36058] " burnus at gcc dot gnu dot org
2008-04-27 13:24 ` w6ws at earthlink dot net
2008-04-27 15:31 ` burnus at gcc dot gnu dot org
2008-04-29  5:22 ` burnus at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-36058-15045@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).