Topic: Defect Report: Storage duration of objects created by calloc(), malloc(), and realloc()


Author: musiphil@bawi.org (KIM Seungbeom)
Date: 07 Jun 03 15:10:56 GMT
Raw View
 [Moderator's note: this defect report has been
 forwarded to the C++ committee. -moderator.]

It is not clear which storage duration is associated with (POD) objects
created by calloc(), malloc(), and realloc().

3.7 [basic.stc] states that there are only three kinds of storage duration:
static, automatic and dynamic. However, ISO/IEC 9899:1990 with TC2 states
that the objects calloc(), malloc(), and realloc() return have "allocated"
storage duration. The C++98 standard neither changes their storage duration
explicitly nor allows them to keep their allocated storage duration, so
there is a logical contradiction.

Proposed resolution: (suggestive only)

  (a) specify that those objects have allocated storage duration, as in C,
     (3.7 [basic.stc] should be modified to reflect this addition.)
  (b) specify that those objects have dynamic storage duration,
     (is it desirable?)
  or whatever.

--
Seungbeom Kim <musiphil@bawi.org>
---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]