[Issue 5452] Signed file lengths and positions

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Jan 26 17:43:35 PST 2015


https://issues.dlang.org/show_bug.cgi?id=5452

AndyC <andy at squeakycode.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |andy at squeakycode.net
         Resolution|---                         |INVALID

--- Comment #1 from AndyC <andy at squeakycode.net> ---
> isn't it better and safer

The C api returns a -1 to indicate error, which the D code catches and raises
an exception.  Since we dont need to return an error as -1, and because files
cannot have a size less than zero, it makes since to use an unsigned type.

I'd say a signed type is neither better or safer.

> Currently unsigned values are quite dangerous in D

I don't know if that's still true, if it is you should open a new bug report
with some test code.

--


More information about the Digitalmars-d-bugs mailing list