|
From: | Andy H |
Subject: | Re: [avr-gcc-list] __builtin_constant_p for inline func args with -Os |
Date: | Sun, 08 Nov 2009 15:43:50 -0500 |
User-agent: | Thunderbird 2.0.0.23 (Windows/20090812) |
Os is not inlining the function - since it believe it will cause code
size to grow. You can find this out by using inline warning option -Winline However, you can FORCE a function to be inlined thus static inline void digitalWrite(uint8_t pin, uint8_t val) __attribute__((always_inline)); static inline void digitalWrite(uint8_t pin, uint8_t val) ...which fixs your problem Andy Paul Stoffregen wrote: I'm trying to create an inline function (instead of a preprocessor macro) which uses __builtin_constant_p to test if its args are compile time constants. According to the manual, this is supposed to work with optimization enabled. |
[Prev in Thread] | Current Thread | [Next in Thread] |