www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6583] New: cast() operation not fully specified

http://d.puremagic.com/issues/show_bug.cgi?id=6583

           Summary: cast() operation not fully specified
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: websites
        AssignedTo: nobody puremagic.com
        ReportedBy: cokebuttle gmail.com



PDT ---
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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 30 2011