avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [avr-gcc-list] GCC native bool compile on mega8


From: Dave Hylands
Subject: RE: [avr-gcc-list] GCC native bool compile on mega8
Date: Wed, 12 Jan 2005 22:56:50 -0800

I typed in the following one line program:

int x() { return sizeof( bool ); }

And compiled it using:

avr-gcc -c -O2 x.cpp

And pinted out the disassembly, using

avr-objdump -D x.o

x.o:     file format elf32-avr

Disassembly of section .text:

00000000 <_Z1xv>:
   0:   81 e0           ldi     r24, 0x01       ; 1
   2:   90 e0           ldi     r25, 0x00       ; 0
   4:   08 95           ret     

So it appears that a bool is a single byte. It certainly isn't a single
bit.

--
Dave Hylands
Vancouver, BC, Canada
http://www.DaveHylands.com/ 

> -----Original Message-----
> From: address@hidden 
> [mailto:address@hidden On Behalf Of A Day
> Sent: Wednesday, January 12, 2005 10:34 PM
> To: address@hidden
> Subject: [avr-gcc-list] GCC native bool compile on mega8
> 
> 
> What does the AVR-GCC compile bools down to? It would be great if a
> bool compiled down to a single bit, but I suspect bools actually take
> up a full byte. I couldn't find this in the FAQ. Thanks ahead of time
> for your insight :-)
> 
> _______________________________________________
> avr-gcc-list mailing list
> address@hidden
> http://www.avr1.org/mailman/listinfo/avr-gcc-list
> 
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]