Movatterモバイル変換


[0]ホーム

URL:


Issue 1313 - WG21 CWG Issues
Title
Undefined pointer arithmetic in constant expressions
Status
cd3
Section
7.7 [expr.const]
Submitter
Jens Maurer

Created on2011-05-07.00:00:00 last changed145 months ago

Messages

msg4002 (view)
Date: 2012-02-15.00:00:00

[Voted into the WP at the February, 2012 meeting;moved to DR at the October, 2012 meeting.]

msg4001 (view)
Date: 2011-08-15.00:00:00

Proposed resolution (August, 2011):

Change 7.7 [expr.const] paragraph 2 as follows:

  • ...

  • a result that is not mathematically defined or not in therange of representable values for its type;

  • an operation that would have undefined behavior[Note: including, for example, signed integer overflow (Clause 7 [expr]), certain pointer arithmetic (7.6.6 [expr.add]), division by zero (7.6.5 [expr.mul]), or certainshift operations (7.6.7 [expr.shift]) —endnote];

  • ...

  • a subtraction (7.6.6 [expr.add]) where bothoperands are pointers;

  • ...

msg3441 (view)
Date: 2012-09-24.00:00:00

The requirements for constant expressions do not currently,but should, exclude expressions that have undefined behavior, such aspointer arithmetic when the pointers do not point to elements of thesame array.

History
DateUserActionArgs
2014-03-03 00:00:00adminsetstatus: drwp -> cd3
2012-11-03 00:00:00adminsetstatus: dr -> drwp
2012-09-24 00:00:00adminsetmessages: +msg4002
2012-09-24 00:00:00adminsetmessages: +msg4001
2012-09-24 00:00:00adminsetstatus: review -> dr
2012-02-27 00:00:00adminsetstatus: ready -> review
2011-05-07 00:00:00admincreate

[8]ページ先頭

©2009-2026 Movatter.jp