This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: sizeof bool > sizeof int ?!?
- To: Per Bothner <bothner at cygnus dot com>
- Subject: Re: sizeof bool > sizeof int ?!?
- From: "Gary V. Vaughan" <gvaughan at oranda dot demon dot co dot uk>
- Date: Fri, 10 Jul 1998 12:24:24 +0100
- CC: EGCS mailing list <egcs at cygnus dot com>, faber at dbai dot tuwien dot ac dot at
- Organization: Aethos Communication Systems ltd.
- References: <199807091912.MAA15746@cygnus.com>
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