From clive@on-the-train.demon.co.uk  Fri Feb  7 16:56:45 1997
Received: from relay-11.mail.demon.net (relay-11.mail.demon.net [194.217.242.137]) by dkuug.dk (8.6.12/8.6.12) with SMTP id QAA18778 for <sc22wg14@dkuug.dk>; Fri, 7 Feb 1997 16:56:44 +0100
Received: from on-the-train.demon.co.uk ([158.152.83.191])
          by relay-9.mail.demon.net  id aa911636; 7 Feb 97 14:45 GMT
Message-ID: <2v3vppAIdz+yEwVy@on-the-train.demon.co.uk>
Date: Fri, 7 Feb 1997 14:08:08 +0000
To: sc22wg14@dkuug.dk
From: "Clive D.W. Feather" <clive@on-the-train.demon.co.uk>
Reply-To: clive@demon.net
Subject: Access to objects - N640
MIME-Version: 1.0
X-Mailer: Turnpike Version 3.03 beta 2 <81yImECxEkLwWotvkdN7a29E6a>

I endorse this proposal. However, I would like to suggest a change.

The fifth bullet point covers access to an object that is part of a
larger object. As worded, this implies that I can access any int
variable using any structure type, such as:

    struct s { double d; int i; } s;
    int a [sizeof s];

    s.d = 1.0; s.i = 2;
    * (struct s *) a = s;

[Okay, in this case the cast might be dubious, but I can write something
similar using malloc.] I don't think this is what we want.

Proposal: replace the fifth bullet point with:

    if an aggregate or union type, a type whose element or member types
    (including recursively element and member types of subaggregates and
    contained unions) are related to the element and member types of the
    effective type of the object in one of the above ways, or

Replace the full stop on the last bullet point with a comma, and add at
the end:

    or as part of an access, conforming to the above requirements, to an
    enclosing object whose effective type is an aggregate or union type.

There's no need to mention recursion, because you simply apply this rule
to the outermost object. And there's no need to have the "that includes"
bit, because the access will be forbidden by "the above requirements".

The present footnote 43 should be expanded to something like:

    This does not mean that an object includes type information within
    itself. Rather, it allows an implementation, by examining the
    effective types of expressions, to determine when an object can or
    cannot be aliased.

-- 
Clive D.W. Feather    | Associate Director  | Director
Tel: +44 181 371 1138 | Demon Internet Ltd. | CityScape Internet Services Ltd.
Fax: +44 181 371 1150 | <clive@demon.net>   | <cdwf@cityscape.co.uk>
Written on my laptop - please reply to the Reply-To address <clive@demon.net>
