From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jason Merrill To: bothner@cygnus.com (Per Bothner), egcs@cygnus.com Subject: Re: bool Date: Tue, 11 Nov 1997 18:44:00 -0000 Message-id: References: <199711112028.MAA08953.cygnus.egcs@cygnus.com> X-SW-Source: 1997-11/msg00442.html >>>>> Per Bothner writes: > Jason Merrill writes: >> Nonsense. Most uses of bool are to store boolean values. Most of these >> values would have been type 'int' if 'bool' were not available. If you >> want packed data, you can use a bitvector or 'unsigned char'. > Most uses of short are to store integer values. Most of these > values would have been type 'int' if 'short' were not available. > What's your point? My point is that C programmers use int to store flags. They could use short or unsigned char, but they use int. Removing a 'typedef int bool' and building with g++ should not make their code slower. Naive users will use bool for a flag, not considering that it might dramatically slow down an inner loop in their code. If a knowledgeable user wants to save space, they can use unsigned char, or a bitvector, or a bitfield for that matter. Basically, this is a space/time tradeoff, and there is no right answer. My opinion is that time is more important. And in any case bool has been 4 bytes on RISC targets for the past couple of years, and I don't think it's worth changing it now. Jason