about gcc compiler option

Jason Holt jason at lunkwill.org
Sun Nov 27 23:05:00 MST 2005


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));
}

[jason at erg] ~$ gcc foo.c
[jason at erg] ~$ ./a.out
Foo! 1 (1)




More information about the PLUG mailing list