Re: One byte bool
Re: One byte bool
- Subject: Re: One byte bool
- From: "Clark Cox" <email@hidden>
- Date: Thu, 16 Mar 2006 14:37:38 -0500
On 3/16/06, Thomas Engelmeier <email@hidden> wrote:
> Am 15.03.2006 um 13:16 schrieb Clark Cox:
>
> > On 3/15/06, Jerry <email@hidden> wrote:
> >>
> >> On 14 Mar 2006, at 22:35, Ben wrote:
> >>
> >>> I've never understood why people prefer things like bool, int, or
> >>> long to the much safer types of unit8, int32, int64, and the like.
> >>
> >> The problem I always find is that you have a fantastic choice between
> >> uint8, uint8_t, UINT8, u_int8, UInt8, U8, guint8, jsuint8 or whatever
> >> name the writers of the libraries
> >
> > Well, my vote goes to uint8_t and friends, as those are part of the
> > C standard.
>
> Those are part of the CURRENT C99 / C++1998 standards.
> Most of the 3rd party code I see is not even compliant to these 7
> year old standards.
True, but 3rd party code expecting a u_wacky8_t, will usually be just
fine if you pass it a uint8_t. Essentially, I use all standard types
in my own code, and avoid other names for the same types introduced by
other libraries whenever possible.
The more people do the same, the more 3rd party code *will* use these
types (after all, your 1st party code is someone else's 3rd party
code) :)
> BTW; I would go for the uint_leastXX_t for most variables where speed
> and not an exact size is required...
True, but if you don't need an exact size and only care about a
minimum size, then why not just use the built in types?:
char - (always at least 8 bits)
int - (always at least 16 bits)
long - (always at least 32 bits)
long long - (always at least 64 bits)
--
Clark S. Cox III
email@hidden
My CV/Resume:
http://homepage.mac.com/clarkcox3/files/Resume.pdf
http://homepage.mac.com/clarkcox3/files/Resume.html
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden