Skip to content

Commit 47314bc

Browse files
authored
Merge pull request #2301 from JohanEngelen/patch-6
[Spec] Clarify `(void*) - (void*)`
2 parents 774b335 + bd515f0 commit 47314bc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spec/expression.dd

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,8 @@ $(GNAME AddExpression):
563563
$(P If both operands are pointers, and the operator is $(D -),
564564
the pointers are subtracted and the
565565
result is divided by the size of the type pointed to by the
566-
operands. It is an error if the pointers point to different types.
566+
operands. In this calculation the assumed size of $(D void) is one byte.
567+
It is an error if the pointers point to different types.
567568
The type of the result is $(D ptrdiff_t).
568569
)
569570

0 commit comments

Comments
 (0)