From 3938962007204310923
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fc772,8d9af67f0c48e4ef
X-Google-Attributes: gidfc772,public
X-Google-Thread: f78e5,8d9af67f0c48e4ef
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2002-05-01 08:35:09 PST
Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!chcgil2-snh1.gtei.net!denver-snf1.gtei.net!news.gtei.net!namche.sun.com!news2me.EBay.Sun.COM!engnews1.eng.sun.com!taumet!clamage
From: brangdon@cix.co.uk (Dave Harris)
Newsgroups: comp.std.c++,comp.lang.c++.moderated
Subject: Re: Unsignedness of size_t
Date: 1 May 2002 15:28:06 GMT
Organization: unknown
Lines: 34
Approved: stephen.clamage@sun.com (comp.std.c++)
Message-ID: <memo.20020430205159.13597K@brangdon.madasafish.com>
References: <3CC7DB8F.52E75D62@bawi.org>
Reply-To: brangdon@cix.co.uk
NNTP-Posting-Host: taumet.eng.sun.com
X-NNTP-Posting-Host: netlab.cs.rpi.edu
X-Original-Date: Tue, 30 Apr 2002 20:51 +0100 (BST)
X-Submission-Address: c++-submit@netlab.cs.rpi.edu
X-Auth: PGPMoose V1.1 PGP comp.lang.c++.moderated
	iQBVAwUAPM8vlEHMCo9UcraBAQEe2AH/UjFhqOji9vj1V5O7/ppLn4jUNcRI35yw
	rjZnTc0T6uWa+owR+ASE/8jin2deDzVp1EYQ1N5stGKsbPHPYhkX+w==
	=6P9B
X-Approved-For-Group: jep@[151.161.11.6] comp.lang.c++.moderated
X-Scanned-By: MIMEDefang 2.3 (www dot roaringpenguin dot com slash mimedefang)
Content-Length: 1402
X-Status: $$$$
X-UID: 0000000001
Originator: clamage@taumet
Xref: archiver1.google.com comp.std.c++:10937 comp.lang.c++.moderated:42432


musiphil@bawi.org (Sungbom Kim) wrote (abridged):
> I often find it somewhat "flawed" that the standard requires the data
> type representing sizes of objects to be an unsigned integral type.

I agree with your sentiments.


> As Stroustrup mentioned in TC++PL 4.4, usage of unsigned integer types
> for that kind of situation is discouraged.

This is rather a special case, though. On some machines, using a signed 
integer would halve the maximum object size. That would be unacceptable.

For example, on a 16-bit machine we might have a single array 36000 chars 
long (taking up more than half the addressable memory). So size_t needs to 
be a 16-bit quantity capable of representing 36000.

  Dave Harris, Nottingham, UK | "Weave a circle round him thrice,
      brangdon@cix.co.uk      |   And close your eyes with holy dread,
                              |  For he on honey dew hath fed
 http://www.bhresearch.co.uk/ |   And drunk the milk of Paradise."



      [ Send an empty e-mail to c++-help@netlab.cs.rpi.edu for info ]
      [ about comp.lang.c++.moderated. First time posters: do this! ]

[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html                       ]




