Bug 6583 – cast() operation not fully specified

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P3
Component
dlang.org
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2011-08-30T22:41:57Z
Last change time
2023-01-31T12:04:05Z
Keywords
pull, spec, trivial
Assigned to
No Owner
Creator
Lennart Blanco

Comments

Comment #0 by cokebuttle — 2011-08-30T22:41:57Z
The D2 language specification does not fully define the conversation performed by cast() operation, http://d-programming-language.org/expression.html#CastExpression. For example cast() between basic data types of different sizes and signess is not described. e.g: int a; byte b = cast(int)a; Casting pointers to basic data types is also not described. I think the specification should define when the value is truncated, sign extended or copied bit-by-bit, etc. Maybe a reference to relevant C language specification would solve this issue.
Comment #1 by dlang-bot — 2023-01-30T13:00:14Z
@Robert21721 updated dlang/dlang.org pull request #3502 "Fix Issue 6583 - cast() operation not fully specified" fixing this issue: - fix issue 6583 - cast() operation not fully specified https://github.com/dlang/dlang.org/pull/3502
Comment #2 by dlang-bot — 2023-01-31T12:04:05Z
dlang/dlang.org pull request #3502 "Fix Issue 6583 - cast() operation not fully specified" was merged into master: - e858a2e893209972fcc08994780fa139c7e5c4e0 by Robert21721: fix issue 6583 - cast() operation not fully specified https://github.com/dlang/dlang.org/pull/3502