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

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

[avr-gcc-list] inline vs. #define


From: Andreas Trenkwalder
Subject: [avr-gcc-list] inline vs. #define
Date: Tue, 25 Mar 2003 13:23:10 +0100

Hi,

How are inline functions handled by avr-gcc?

if i use 
#define i2c_wait() while (!(TWCR & _BV(TWINT)))

avr-size says: 
text       data     bss     dec     hex filename
388           0       1     389     185 i2c.elf


instead if i use 
inline void i2c_wait(void) 
{
        while (!(TWCR & _BV(TWINT)));
}

avr-size output looks like
text       data     bss     dec     hex filename
398           0       1     399     18f i2c.elf

Why is there a difference in size?


Any help would be appreciated.
Andreas




reply via email to

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