Title
definition of get_pointer_safety()
Status
c++11
Section
[util.dynamic.safety]
Submitter
Jens Maurer

Created on 2009-04-03.00:00:00 last changed 161 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

In [util.dynamic.safety] p16, replace the description of get_pointer_safety() with:

pointer_safety get_pointer_safety();

Returns: an enumeration value indicating the implementation's treatment of pointers that are not safely derived (3.7.4.3). Returns pointer_safety::relaxed if pointers that are not safely derived will be treated the same as pointers that are safely derived for the duration of the program. Returns pointer_safety::preferred if pointers that are not safely derived will be treated the same as pointers that are safely derived for the duration of the program but allows the implementation to hint that it could be desirable to avoid dereferencing pointers that are not safely derived as described. [Example: pointer_safety::preferred might be returned to detect if a leak detector is running to avoid spurious leak reports. -- end note] Returns pointer_safety::strict if pointers that are not safely derived might be treated differently than pointers that are safely derived.

Returns: Returns pointer_safety::strict if the implementation has strict pointer safety ([basic.stc.dynamic.safety]). It is implementation-defined whether get_pointer_safety returns pointer_safety::relaxed or pointer_safety::preferred if the implementation has relaxed pointer safety ([basic.stc.dynamic.safety]).Footnote

Throws: nothing

Footnote) pointer_safety::preferred might be returned to indicate to the program that a leak detector is running so that the program can avoid spurious leak reports.

Date: 2010-10-21.18:28:33

[ 2009-10 Santa Cruz: ]

The core issue is 853 and is in Ready status.

Date: 2010-10-21.18:28:33

[ Batavia (2009-05): ]

We recommend if this issue is to be moved, the issue be moved concurrently with the cited Core issue.

We agree with the intent of the proposed resolution. We would like input from garbage collection specialists.

Move to Open.

Date: 2009-04-03.00:00:00

Addresses DE 18

In [util.dynamic.safety], get_pointer_safety() purports to define behavior for non-safely derived pointers ([basic.stc.dynamic.safety]). However, the cited core-language section in paragraph 4 specifies undefined behavior for the use of such pointer values. This seems an unfortunate near-contradiction. I suggest to specify the term relaxed pointer safety in the core language section and refer to it from the library description. This issue deals with the library part, the corresponding core issue (c++std-core-13940) deals with the core modifications.

See also N2693.

History
Date User Action Args
2011-08-23 20:07:26adminsetstatus: wp -> c++11
2010-10-21 18:28:33adminsetmessages: + msg713
2010-10-21 18:28:33adminsetmessages: + msg712
2010-10-21 18:28:33adminsetmessages: + msg711
2009-04-03 00:00:00admincreate