Xref: utzoo gnu.g++.lib.bug:41 gnu.g++.bug:469 Path: utzoo!telly!attcan!uunet!tut.cis.ohio-state.edu!rutgers!columbia!cs!fox From: fox@cs.cs.columbia.edu (David Fox) Newsgroups: gnu.g++.lib.bug,gnu.g++.bug Subject: bool too big Message-ID: Date: 19 Apr 89 14:02:54 GMT Sender: news@cs.columbia.edu Organization: Columbia University Computer Science Lines: 28 It seems that the type "bool" defined in stddef.h uses four bytes to store a truth value! Witness: #include #include main() { bool x; cout << sizeof (x) << "\n"; } When run: del:/tmp% g++-1.34.2 -O -g test.cc del:/tmp% a.out 4 del:/tmp% This is both about libg++ and about g++ (and, I suppose, about C.) I guess I hoped that using enumerated types would at least buy me objects of the smallest size necessary to hold the correct number of alternatives. I am opposed to changing the behavior of features already established in C, but I would favor the addition of new aggragate types to provide strongly typed and/or minimum size enumerations. David Fox