This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: sizeof bool > sizeof int ?!?


Per Bothner wrote:
> 
> > Certainly code will run faster on most 32bit architectures using int's
> > (32 bits) rather than char's (8 bits), so it makes sense to use, e.g.
> > typedef int bool;
> 
> Why stop there?  We should by the same argument:
> 
>     typedef int short;

Surely you mean

#define short int

??? =)O|

...but yes, bizarre though it may sound, using shorts is a trading speed
for space (modulo the architecture instruction set), except perhaps in
the pedagogical case quoted earlier in the thread where the
proliferation of register width words in place of narrower types causes
additional page faults...

short array[10000];

anyone?

OTOH, please correct me if I am grossly misinformed.

Cheers,
	Gary V. Vaughan
begin:          vcard
fn:             Gary Vaughan
n:              Vaughan;Gary
org:            Aethos Communication Systems ltd.
email;internet: gvaughan@oranda.demon.co.uk
tel;work:       01454 - 204411
x-mozilla-cpt:  ;0
x-mozilla-html: FALSE
version:        2.1
end:            vcard


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]