TIP: Click on subject to list as thread! ANSI
echo: c_echo
to: Roy.J..Tellason!1.270.615.0{at}filegat
from: Bob Stout
date: 2004-01-19 11:51:00
subject: Re: [C] (Thanks)An interesting question

From: Bob Stout 

On 19 Jan 2004 Roy.J..Tellason!1.270.615.0{at}filegate.net wrote:

> I just wish that some folks would _do_ that when they write stuff,
> instead of it being the default for whatever the case may be.  Like
> using a "long" to represent the quantity of free space on a
hard drive.
> That number is _never_ going to go negative, so "unsigned"
should be in
> there too, but enough programmers left it out (laziness? some other
> reason?) that >2G drives break an awful lot of software.  Or did,
> anyhow, under dos for one example.

This was done for the same reason as character operations return an int. A
return value of -1 was useful for returning error conditions. You can't
return an unsigned long of -1. Nowadays, the safest practice would be to
use an unsigned long long.

-------------------------------------------------------------
Consulting: http://www.MicroFirm.biz/ Web graphics development:
http://Image-Magicians.com/ Software archives:
http://snippets.snippets.org/
  c.snippets.org/   cpp.snippets.org/      java.snippets.org/
  d.snippets.org/   python.snippets.org/   perl.snippets.org/
  dos.snippets.org/ embedded.snippets.org/ apps.snippets.org/
Audio and loudspeaker design:
  http://LDSG.snippets.org/   http://www.diyspeakers.net/

--- BBBS/LiI v4.01 Flag-5
* Origin: Prism's_Point (1:261/38.1)
SEEN-BY: 633/267 270
@PATH: 261/38 123/500 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.