• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Why are BOOL and bool distinct types?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why are BOOL and bool distinct types?


  • Subject: Re: Why are BOOL and bool distinct types?
  • From: "Sean McBride" <email@hidden>
  • Date: Wed, 8 Jun 2005 10:08:44 -0400
  • Organization: Rogue Research

On 2005-06-08 01:44, Todd Blanchard said:

>Digging around the header of NSMethodInvocation I see a
>NSObjCBoolType 'B' tag has been added.  Nifty, so why is @encode
>(BOOL) == c but @encode(bool) == 'B'?

It's historical.  When Obj-C was invented C did not have a 'bool' so
they typedef'ed one as BOOL = char.

But since C99, C does have a bool type (<http://www.comeaucomputing.com/
techtalk/c99/#bool>) but Apple keeps their old one around for
compatibility I guess.

Maybe BOOL should be deprecated now that C99 has a native type?

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Why are BOOL and bool distinct types?
      • From: Fritz Anderson <email@hidden>
References: 
 >Why are BOOL and bool distinct types? (From: Todd Blanchard <email@hidden>)

  • Prev by Date: Fullscreen code not working (code revisions)
  • Next by Date: universal binary compilation errors
  • Previous by thread: [Moderator] Re: Why are BOOL and bool distinct types?
  • Next by thread: Re: Why are BOOL and bool distinct types?
  • Index(es):
    • Date
    • Thread