public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "burnus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/47024] [OOP] STORAGE_SIZE (for polymorphic types): Segfault at run time
Date: Mon, 20 Dec 2010 16:48:00 -0000	[thread overview]
Message-ID: <bug-47024-4-3pkwkhdtRg@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-47024-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> 2010-12-20 16:47:56 UTC ---
(In reply to comment #2)
> I don't really understand this. Why should one allow it for unallocated
> allocatables, but not for undefined pointers?

Well, the situation for an unassociated pointer and for an unallocated
allocatable is the same: You know that it does not have a dynamic type -- and
you can check for this state via "<array>.data == NULL" or "<scalar> == NULL".

In case of an undefined pointer, you cannot. Thus, not allowing undefined
pointers anywhere makes sense.


The initially proposed wording was did not allow for notallocated
allocatables/notassociated pointers
(http://www.j3-fortran.org/doc/year/06/06-166.txt) but during the meeting 176
meeting the wording of 06-166 was changed (in two revisions, r1 and r2) to what
we have today; cf.
http://www.j3-fortran.org/doc/meeting/176/06-166r2.txt.

Unfortunately, the new version does not clearly tell what the result value
should be in that case. Possible choices would be: (a) storage size of the
declared type or (b) "zero" or the size of the class container.

If (b) is the correct answer, I do not see the reason for the additional
restrictions for types with "deferred type parameters" and for "unlimited
polymorphic" - one could simply return the same as for an unallocated
polymorphic.

Thus, I assume that (a) is meant, but I do not see how one can read this from
the standard (as opposed to guessing it).

Let's see what the J3 members think how it should be interpreted; I think
ultimately an interpretation request is required.


  parent reply	other threads:[~2010-12-20 16:48 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-20  9:35 [Bug fortran/47024] New: " burnus at gcc dot gnu.org
2010-12-20  9:47 ` [Bug fortran/47024] " burnus at gcc dot gnu.org
2010-12-20 15:17 ` janus at gcc dot gnu.org
2010-12-20 16:48 ` burnus at gcc dot gnu.org [this message]
2011-01-04 13:39 ` janus at gcc dot gnu.org
2011-01-04 13:49 ` janus at gcc dot gnu.org
2011-01-04 18:58 ` janus at gcc dot gnu.org
2011-01-05  9:05 ` janus at gcc dot gnu.org
2011-01-05  9:17 ` janus at gcc dot gnu.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-47024-4-3pkwkhdtRg@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).