A new edition of the ISO C standard was published in 1999 as ISO/IEC 9899:1999,
and is commonly known as C99. GCC has incomplete support for this standard
version; seehttp://gcc.gnu.org/c99status.html
for details. To select this standard, use `-std=c99' or `-std=iso9899:1999'.
(While in development, drafts of this standard version were referred to
asC9X.)
On 11 Nov 2002 at 10:14, Rob Ward wrote:
Hi Eric and others. I have used your suggestion below, but in some
cases it does not compile as you have suggested. For example...
#define SetClockHigh() (PORTD |= 0x80) // set clock line high
#define SetClockLow() (PORTD &= ~0x80) // set clock line low
SetClockHigh(); // set clock line hi
5e: 97 9a sbi 0x12, 7 ; 18
SetClockLow(); // set clock line low
60: 82 b3 in r24, 0x12 ; 18
62: 83 23 and r24, r19
64: 82 bb out 0x12, r24 ; 18
This is using -O2 or -O3 optimisation. However if I change to -Os I
get a mixture in various places...
SetClockHigh(); // set clock line hi
b0: 97 9a sbi 0x12, 7 ; 18
SetClockLow(); // set clock line low
b2: 3f e7 ldi r19, 0x7F ; 127
b4: 82 b3 in r24, 0x12 ; 18
b6: 83 23 and r24, r19
b8: 82 bb out 0x12, r24 ; 18
and also...
SetClockHigh(); // set clock line hi
84: 97 9a sbi 0x12, 7 ; 18
SetClockLow(); // set clock line low
86: 97 98 cbi 0x12, 7 ; 18
Is this something that could be improved or am I missing something?
TIA.
Rob
The version of GCC that I use is 3.2 experimental, from the latest
AVRFreaks distribution. For compiler flags I use -Os as well as
-std=gnu99. Does yours match, what do you use?
Let me know,
Thanks.
Eric
avr-gcc-list at http://avr1.org