This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: sizeof bool > sizeof int ?!?
On Sun, Jul 05, 1998 at 11:55:31AM +0200, Rask Ingemann Lambertsen wrote:
> Den 03-Jul-98 15:15:06 skrev Gerald Pfeifer følgende om "sizeof bool > sizeof int ?!?":
>
> > with egcs-2.90.29 980515 (egcs-1.0.3 release) on alphaev56-dec-osf4.0d
> > and -- surprise, surprise! -- sizeof bool > sizeof int !?!
>
> > bool = 8
> > short = 2
> > int = 4
> > long = 8
>
> > I find it _very_ hard calling this a feature!
>
> > Even if it may be standards compliant, this is most surprising for
> > 95%[1] of all developers.
>
> Possibly, but does it have any impact on the code? Apart form wasting huge
> amounts of memory, that is?
IIRC, the AXP series handle 64bit words faster than 32bit words due to
register width and/or instruction set.
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;
my £0.005 =)O|
Cheers,
--
___ _ ___ __ _
/ __|__ _ _ ___ _| | / / | / /_ _ _ _ __ _| |_ __ _ ___
| (_ / _` | '_|// / |/ /| |/ / _` | || / _` | ' \/ _` | _ \
\___\__,_|_|\_, /|___(_)___/\__,_|\_,_\__, |_||_\__,_|//_/
PGP Key from/___/ /___/
http://www.cl.cam.ac.uk/PGP/pks-commands.html#extract
http://pgp.ai.mit.edu/~bal/pks-commands.html#extract
PGP signature