public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* sizeof (_Bool)
@ 2002-04-26 15:52 Stan Shebs
  2002-04-26 16:29 ` Joseph S. Myers
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Stan Shebs @ 2002-04-26 15:52 UTC (permalink / raw)
  To: gcc

When Joseph Myers added _Bool as part of his C99 work
(see http://gcc.gnu.org/ml/gcc-patches/2000-10/msg01127.html), he
chose to give it the same size as chars, even though this made
it binary incompatible with the previous typedef of "bool" as
int in stdbool.h.

Well, it bit somebody here using almost-3.1 to compile part of
Mac OS X.  We've been using stdbool.h for some time to provide a
basic definition of bool, and there is lots of API that makes
reference to bool, for instance in fields of structs.  Now it
happens that these APIs are generally internal, but of course
we expect to deliver apps such as iPhoto that will work on 10.1
(which is built with 2.95.2 and thus has 4-byte bools) and later
OSes built with 3.1, plus we don't know how many third parties
have already delivered libraries with 4-byte bools wired into
their interfaces.

Since there are now millions of machines out in the field with
OS X on them, you can imagine that we're pretty worried about
binary compatibility - we don't want Grandma's family pictures
trashed by a newly-downloaded iPhoto!

So we're proposing to make _Bool's size target-specific, and
to add a macro something like BOOL_TYPE_SIZE that can default
to CHAR_TYPE_SIZE, and that Darwin configs can set to 32.  I'd
appreciate any comments or feedback on the idea, including
possible gotchas relating to C++ bool.

Also, if anybody knows of any *other* C ABI changes between 2.95
and 3.1, I'd sure like to hear about them.  Presumably there aren't
many, since we've been building mixed systems for months and haven't
really been hosed before now.  Thanks!

Stan

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2002-05-02 15:27 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-26 15:52 sizeof (_Bool) Stan Shebs
2002-04-26 16:29 ` Joseph S. Myers
2002-04-26 16:49   ` Stan Shebs
2002-04-26 17:53     ` Joseph S. Myers
2002-05-02  6:15       ` PATCH " Jason Merrill
2002-05-02  8:27         ` Stan Shebs
2002-04-26 16:30 ` mike stump
2002-04-29 22:42 ` Aldy Hernandez
2002-04-30 10:29   ` Dale Johannesen
2002-04-30 17:44     ` Aldy Hernandez
2002-05-02  5:43       ` Jason Merrill

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).