On Mon, Nov 28, 2005 at 06:05:00AM +0000, Jason Holt wrote:
> 
> On Mon, 28 Nov 2005, Laurent R wrote:
> 
> >I used gcc version 3.3.2;
> >How can I change the 'bool' variable from 4 byte (default value) to 1 
> >byte. I used the '-mone-byte-bool', but this gcc of version 3.3.2 does not 
> >recogize this option.
> 
> This seems to work:
> 
> 
> #include <stdio.h>
> 
> typedef char bool;
> main() {
>         bool foo=1;
>         printf("Foo! %d (%d)\n", foo, sizeof(foo));
> }
> 
> [EMAIL PROTECTED] ~$ gcc foo.c
> [EMAIL PROTECTED] ~$ ./a.out
> Foo! 1 (1)

sizeof (foo) is not necessarily the same as the amount of space
required by foo. Processors that require alignment on word boundaries
(e.g. PDP-11, 68000) may force padding.

-- 

Charles Curley                  /"\    ASCII Ribbon Campaign
Looking for fine software       \ /    Respect for open standards
and/or writing?                  X     No HTML/RTF in email
http://www.charlescurley.com    / \    No M$ Word docs in email

Key fingerprint = CE5C 6645 A45A 64E4 94C0  809C FFF6 4C48 4ECD DFDB

Attachment: pgpQesR8vLj7G.pgp
Description: PGP signature

/*
PLUG: http://plug.org, #utah on irc.freenode.net
Unsubscribe: http://plug.org/mailman/options/plug
Don't fear the penguin.
*/

Reply via email to