stdio.h in 0011 broken

Something seems to have been changed in Arduino 0011, and apparently has broken the AVR stdio.h. The code still compiles in 0010, but gives errors in 11. I thought it might be the order of includes, so I rearranged mine some, but didn't do anything. My sketch needs it for some sprintf junk.

c:/documents and settings/marc/desktop/embedded dev/arduino/arduino-0011/hardware/tools/avr/bin/../avr/include/stdio.h:263: error: expected unqualified-id before 'int'

c:/documents and settings/marc/desktop/embedded dev/arduino/arduino-0011/hardware/tools/avr/bin/../avr/include/stdio.h:263: error: expected `)' before 'int'

c:/documents and settings/marc/desktop/embedded dev/arduino/arduino-0011/hardware/tools/avr/bin/../avr/include/stdio.h:263: error: expected `)' before 'int'

c:/documents and settings/marc/desktop/embedded dev/arduino/arduino-0011/hardware/tools/avr/bin/../avr/include/stdio.h:264: error: expected unqualified-id before 'int'

c:/documents and settings/marc/desktop/embedded dev/arduino/arduino-0011/hardware/tools/avr/bin/../avr/include/stdio.h:264: error: expected `)' before 'int'

c:/documents and settings/marc/desktop/embedded dev/arduino/arduino-0011/hardware/tools/avr/bin/../avr/include/stdio.h:264: error: expected `)' before 'int'

c:/documents and settings/marc/desktop/embedded dev/arduino/arduino-0011/hardware/tools/avr/bin/../avr/include/stdio.h:417: error: '__put' was not declared in this scope

c:/documents and settings/marc/desktop/embedded dev/arduino/arduino-0011/hardware/tools/avr/bin/../avr/include/stdio.h:417: error: expected primary-expression before 'char'

c:/documents and settings/marc/desktop/embedded dev/arduino/arduino-0011/hardware/tools/avr/bin/../avr/include/stdio.h:417: error: expected primary-expression before 'struct'

c:/documents and settings/marc/desktop/embedded dev/arduino/arduino-0011/hardware/tools/avr/bin/../avr/include/stdio.h:417: error: '__get' was not declared in this scope

c:/documents and settings/marc/desktop/embedded dev/arduino/arduino-0011/hardware/tools/avr/bin/../avr/include/stdio.h:417: error: expected primary-expression before 'struct'

c:/documents and settings/marc/desktop/embedded dev/arduino/arduino-0011/hardware/tools/avr/bin/../avr/include/stdio.h:417: error: initializer expression list treated as compound expression

If you want my sketch code as well, just holler.

I had a similar problem, here is a work around posted by mellis

This bug is caused by the new function-like casts that I added to Arduino 0011 for consistency with Processing and Wiring (and to avoid having an extra kind of syntax). That is, you can say:

byte b = 5;
int x = int(b);

Unfortunately, this interferes with places where int is used as the return type of a function pointer, as in stdio.h:

int (*put)(char, struct __file ); / function to write one char to device */

To work-around the problem, you can put:

#undef int()

before the:

#include <stdio.h>

Hi,

This bug is caused by the new function-like casts that I added to Arduino 0011 for consistency with Processing and Wiring (and to avoid having an extra kind of syntax). That is, you can say:

byte b = 5; int x = int(b);

I think the workaround is harder to communicate than the fact that you cannot use function-like casts. My vote goes to remove this bug... ahh sorry feature... ahhh No I still think its a bug :-)

Eberhard

Seems the discussion's mostly over here: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1206744591/6#6