🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.g++.lib.bug
Article #282

size_t should be typedef

#282
From: Lewis G. Pringle
Date: Wed, 09 Sep 1992 00:37
17 lines
1146 bytes
In libg++ 2.1 it seems that size_t is made to be a #define. This has the
unfortunate side-effect of breaking code which uses functional cast notation
to cast to type size_t.

eg:
	size_t	fred	=	size_t (1);

fails to compile, because size_t is expanded as a #define to unsigned int.

If you must check all over the place if it is defined, why not use __size_t or
some such thing? Or at least, if you MUST use a #define here, please #define to
a simple type name - (first cons up bogus typedef like
typedef unsigned int _nobody_would_ever_use_this_, and then #define size_t _nobody_would_ever_use_this_.
At least this way, my code would compile :-).


			Lewis.
Technical Details
Message-ID: <m0mSG48-000AWzC@sophists.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!sun-barr!cs.utexas.edu!sdd.hp.com!swrinde!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!sophists.COM!lewis

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!sun-barr!cs.utexas.edu!sdd.hp.com!swrinde!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!sophists.COM!lewis
From: lewis@sophists.COM (Lewis G. Pringle)
Newsgroups: gnu.g++.lib.bug
Subject: size_t should be typedef
Message-ID: <m0mSG48-000AWzC@sophists.com>
Date: 9 Sep 92 00:37:00 GMT
Sender: gnulists@ai.mit.edu
Reply-To: lewis@sophists.com
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 17
Approved: bug-lib-g++@prep.ai.mit.edu