Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.
/ druntime Public archive

Always use same-type pointers when subtracting them#1737

Merged
DmitryOlshansky merged 1 commit intodlang:masterfrom
LemonBoy:correct-cast
Jan 15, 2017
Merged

Always use same-type pointers when subtracting them#1737
DmitryOlshansky merged 1 commit intodlang:masterfrom
LemonBoy:correct-cast

Conversation

@LemonBoy
Copy link
Contributor

If both operands are pointers, and the operator is -, the pointers are subtracted and the result is divided by the size of the type pointed to by the operands. It is an error if the pointers point to different types. The type of the result is ptrdiff_t.

See DMD's PR here

@DmitryOlshansky
Copy link
Member

LGTM

@DmitryOlshansky
Copy link
Member

Auto-merge toggled on

@DmitryOlshansky DmitryOlshansky merged commit 52a3ce1 into dlang:master Jan 15, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants