When I try to compile some code for the Arduino I get a weird error that I do not unbderstand, see below. It happens at a statement where I use a sscanf as follows:
sscanf (buffer, TX_FORMAT_1, &lat, &lng, &alt, &ap_groundspeed, &ap_heading);
When I do a sscanf for only one variable the code compiles well. I do not know what this error is and how to prevent it. Workarounds are appreciated as well.
Edit:
I forgot to mention that the compiler version is 1.6.9. The problem is solved when "upgrading" to version 1.0.6.
Error message:
Arduino: 1.6.9 (Windows 7), TD: 1.29, Board: "Arduino/Genuino Micro"
C:\Users\arnold\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.13\cores\arduino\main.cpp: In function 'main':
C:\Users\arnold\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.13\cores\arduino\main.cpp:51:1: error: unable to find a register to spill in class 'NO_REGS'
}
^
C:\Users\arnold\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.13\cores\arduino\main.cpp:51:1: error: this is the insn:
(insn 607 604 610 45 (set (mem:QI (post_dec:HI (reg/f:HI 32 __SP_L__)) [0 S1 A8])
(subreg:QI (reg/f:HI 658) 1)) sketch\coordinates.cpp:23 1 {pushqi1}
(expr_list:REG_ARGS_SIZE (const_int 1 [0x1])
(nil)))
C:\Users\arnold\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.13\cores\arduino\main.cpp:51: confused by earlier errors, bailing out
lto-wrapper: C:\Users\arnold\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\4.9.2-atmel3.5.3-arduino2/bin/avr-gcc returned 1 exit status
c:/users/arnold/appdata/local/arduino15/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.3-arduino2/bin/../lib/gcc/avr/4.9.2/../../../../avr/bin/ld.exe: lto-wrapper failed
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino/Genuino Micro.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.