energia / cc3200-core

6 stars 10 forks source link

itoa.h Issue with CC3200 Examples #19

Closed rei-vilo closed 6 years ago

rei-vilo commented 7 years ago

The WiFiWebClient.ino example fails to compile with this error.

"~/Library/Energia15/packages/energia/tools/arm-none-eabi-gcc/6.3.1-20170620/bin/arm-none-eabi-g++" -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -nostdlib -fno-threadsafe-statics --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -Dprintf=iprintf -MMD -mcpu=cortex-m4 -mthumb -DF_CPU=80000000L -DARDUINO=10610 -DENERGIA=10610 -DENERGIA_CC3200-LAUNCHXL -DENERGIA_ARCH_CC3200 "-I~/Library/Energia15/packages/energia/hardware/cc3200/1.0.2/variants/CC3200-LAUNCHXL" "-I~/Library/Energia15/packages/energia/hardware/cc3200/1.0.2/system/driverlib" "-I~/Library/Energia15/packages/energia/hardware/cc3200/1.0.2/system/inc" "-I~/Library/Energia15/packages/energia/hardware/cc3200/1.0.2/system" -mcpu=cortex-m4 -mthumb -mfloat-abi=soft -mabi=aapcs "-I~/Library/Energia15/packages/energia/hardware/cc3200/1.0.2/system/libsam" "-I~/Library/Energia15/packages/energia/hardware/cc3200/1.0.2/system/CMSIS/CMSIS/Include/" "-I~/Library/Energia15/packages/energia/hardware/cc3200/1.0.2/system/CMSIS/Device/ATMEL/" "-I~/Library/Energia15/packages/energia/hardware/cc3200/1.0.2/cores/cc3200" "-I~/Library/Energia15/packages/energia/hardware/cc3200/1.0.2/variants/CC3200-LAUNCHXL" "-I~/Library/Energia15/packages/energia/hardware/cc3200/1.0.2/libraries/WiFi" "/var/folders/px/cyfvtr757lqg0yp_cv9j79jh0000gn/T/build0d1587afb6c57dc7e7ff7cc898bcb84c.tmp/sketch/WiFiWebClient.ino.cpp" -o "/var/folders/px/cyfvtr757lqg0yp_cv9j79jh0000gn/T/build0d1587afb6c57dc7e7ff7cc898bcb84c.tmp/sketch/WiFiWebClient.ino.cpp.o"
In file included from ~/Library/Energia15/packages/energia/tools/arm-none-eabi-gcc/6.3.1-20170620/arm-none-eabi/include/string.h:10:0,
                 from ~/Library/Energia15/packages/energia/hardware/cc3200/1.0.2/cores/cc3200/Energia.h:8,
                 from ~/Library/Energia15/packages/energia/hardware/cc3200/1.0.2/cores/cc3200/Arduino.h:3,
                 from /var/folders/px/cyfvtr757lqg0yp_cv9j79jh0000gn/T/build0d1587afb6c57dc7e7ff7cc898bcb84c.tmp/sketch/WiFiWebClient.ino.cpp:1:
~/Library/Energia15/packages/energia/tools/arm-none-eabi-gcc/6.3.1-20170620/arm-none-eabi/include/stdlib.h:225:8: error: conflicting declaration of C function 'char* utoa(unsigned int, char*, int)'
 char * _EXFUN(utoa,(unsigned, char *, int));
        ^
In file included from ~/Library/Energia15/packages/energia/hardware/cc3200/1.0.2/cores/cc3200/Energia.h:10:0,
                 from ~/Library/Energia15/packages/energia/hardware/cc3200/1.0.2/cores/cc3200/Arduino.h:3,
                 from /var/folders/px/cyfvtr757lqg0yp_cv9j79jh0000gn/T/build0d1587afb6c57dc7e7ff7cc898bcb84c.tmp/sketch/WiFiWebClient.ino.cpp:1:
~/Library/Energia15/packages/energia/hardware/cc3200/1.0.2/cores/cc3200/itoa.h:34:14: note: previous declaration 'char* utoa(long unsigned int, char*, int)'
 extern char* utoa( unsigned long value, char *string, int radix ) ;
              ^~~~
Using library WiFi at version 1.0.0 in folder: ~/Library/Energia15/packages/energia/hardware/cc3200/1.0.2/libraries/WiFi 
exit status 1
Error compiling for board CC3200-LAUNCHXL (80MHz).
rei-vilo commented 7 years ago

Other examples, even the most trivial blink, fails to compile with the same error.

Shifting the arm-none-eabi-gcc tool-chain from 6.3.1-20170620 to 4.8.4-20140725 solves the issue.

The 6.3.1-20170620 version already packs the utoa() and itoa() functions in stdlib.h, contrary to the 4.8.4-20140725 version, hence the conflict with itoa.h.

robertinant commented 6 years ago

fixed with fbc3f83376f7c8fff1a842db030d263c3e4f236d