From -3240453585492897033
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1149ec,a050958d123ab616
X-Google-Attributes: gid1149ec,public
X-Google-Thread: f78e5,a050958d123ab616
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 1994-07-11 18:30:27 PST
Newsgroups: comp.std.c,comp.std.c++
Path: bga.com!news.sprintlink.net!hookup!yeshua.marcam.com!MathWorks.Com!europa.eng.gtefsd.com!howland.reston.ans.net!pipex!hunts.x.co.uk!scone.london.sco.com!clive
From: clive@sco.com (Clive D.W. Feather)
Subject: Re: storage duration of malloced objects (was Re: reinterpret cast ...)
Organization: Santa Cruz Operation Ltd., Watford, United Kingdom
Date: Mon, 11 Jul 1994 19:08:27 GMT
Message-ID: <CssII5.Cos@scone.london.sco.com>
References: <7JUL199421482411@lando.hns.com> <CsM856.C6u@scone.london.sco.com> <1994Jul8.162050.12302@sal.wisc.edu>
Lines: 38
Xref: bga.com comp.std.c:1896 comp.std.c++:3225

In article <1994Jul8.162050.12302@sal.wisc.edu>,
Alan Watson <alan@sal.wisc.edu> wrote:
> In article <CsM856.C6u@scone.london.sco.com>
> clive@sco.com (Clive D.W. Feather) wrote:
>> 6.1.2.4 *says* that there are
>> two lifetimes for objects, auto and static, and by implication that
>> there are none others.
> 6.1.2.4 does indeed enumerate only two storage durations -- `static'
> and `automatic'.  However, it only defines the implications of those
> storage durations for objects with identifiers (in the first sentences
> of the second and third paragraphs).  Heap objects have no identifiers,
> and so 6.1.2.4 leaves undefined their actual storage duration and the
> implications of that storage duration.

The second paragraph is:
|| An object whose identifier is declared with external or internal linkage,
|| or with the storage-class specifier static has static storage duration.
|| For such an object, storage is reserved and its stored value is
|| initialized only once, prior to program startup. The object exists and
|| retains its last-stored value throughout the execution of the entire
|| program.
[The third paragraph has the same format but is longer.]

I read this as saying two things:
* An object declared thus has static storage duration. It does *not* say
  that *only* these objects have static storage duration. There exist
  objects, such as those defined by the system library, which are not
  declared in this way and yet which have static storage duration.
* Objects with static storage duration have certain properties.

That leaves the storage duration of heap objects undefined; a Defect
Report is being submitted.

-- 
Clive D.W. Feather     | Santa Cruz Operation    | If you lie to the compiler,
clive@sco.com          | Croxley Centre          | it will get its revenge.
Phone: +44 923 816 344 | Hatters Lane, Watford   |   - Henry Spencer
Fax:   +44 923 210 352 | WD1 8YN, United Kingdom |


