This is an unofficial snapshot of the ISO/IEC JTC1 SC22 WG21 Core Issues List revision 117b. See http://www.open-std.org/jtc1/sc22/wg21/ for the official list.
2025-08-11
1313. Undefined pointer arithmetic in constant expressionsSection: 7.7 [expr.const] Status: CD3 Submitter: Jens Maurer Date: 2011-05-07[Voted into the WP at the February, 2012 meeting; moved to DR at the October, 2012 meeting.]
The requirements for constant expressions do not currently, but should, exclude expressions that have undefined behavior, such as pointer arithmetic when the pointers do not point to elements of the same array.
Proposed resolution (August, 2011):
Change 7.7 [expr.const] paragraph 2 as follows:
...
a result that is not mathematically defined or not in the range 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 certain shift operations (7.6.7 [expr.shift]) —end note];
...
a subtraction (7.6.6 [expr.add]) where both operands are pointers;
...
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4