Pages: [1]   Go Down
Author Topic: stdio.h in 0011 broken  (Read 4041 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Jr. Member
**
Karma: 1
Posts: 64
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

London
Offline Offline
Faraday Member
**
Karma: 10
Posts: 6249
Have fun!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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>

Logged

Wuppertal/Germany
Offline Offline
God Member
*****
Karma: 1
Posts: 895
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

0
Offline Offline
Jr. Member
**
Karma: 1
Posts: 64
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Pages: [1]   Go Up
Jump to: