[Issue 3850] New: Signed/unsigned bytes type name

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Feb 24 02:33:16 PST 2010


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

           Summary: Signed/unsigned bytes type name
           Product: D
           Version: 2.040
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2010-02-24 02:33:14 PST ---
While programming in D I have seen that you can forget that the "byte" is
signed. (Because normally I think of bytes as unsigned entities. Other people
share the same idea). (It's similar but not equal to the situation of signed
and unsigned chars in C).

There are several ways to solve this small problem. One of the simpler ways I
can think of is to deprecate the "byte" type name and introduce a "sbyte" type
name (that replaces the "byte" type name). Using a sbyte it's probably quite
more easy to not forget that it's a signed value.

This introduces an inconstancy in the naming scheme of D integral values (they
are now symmetric, ubyte, byte, int, uint, etc), but it can help avoid some
bugs, especially from D newbies.

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


More information about the Digitalmars-d-bugs mailing list