Go Down

Topic: stdio.h in 0011 broken (Read 5051 times) previous topic - next topic

MysteriousAges

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.

Quote
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.

mem

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

Quote
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>



wayoda

Hi,
Quote
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

MysteriousAges

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

Go Up