Skip to content

Fix conflict with declaration in std lib and gcc version > 4.9.2. See issue #4002 #4830

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

jlbirccyn
Copy link

See issue #4002

@sandeepmistry
Copy link
Contributor

@jlbirccyn thank you for submitting this!

I just tried it with gcc-arm-none-eabi-5_3-2016q1, but get the following build error:

/Users/smistry/Documents/Arduino/hardware/arduino/sam/cores/arduino/itoa.c:124:14: error: conflicting types for 'utoa'
 extern char* utoa( unsigned long value, char *string, int radix )
              ^
In file included from /Users/smistry/Documents/Arduino/hardware/arduino/sam/cores/arduino/itoa.c:19:0:
/Users/smistry/Documents/Arduino/hardware/arduino/sam/cores/arduino/itoa.h:38:14: note: previous declaration of 'utoa' was here
 extern char* utoa( unsigned value, char *string, int radix ) ;
              ^
exit status 1
Error compiling for board Arduino Due (Programming Port).

Is there any reason why the equivalent change from itoa.h is not in itoa.c?

@sandeepmistry sandeepmistry added the Waiting for feedback More information must be provided before we can proceed label Apr 7, 2016
sandeepmistry added a commit to sandeepmistry/ArduinoCore-samd that referenced this pull request Apr 7, 2016
@joshingyou
Copy link

Agree with @sandeepmistry just tried your change and got the same error about conflicting declaration of utoa

@cmaglie
Copy link
Member

cmaglie commented Jul 1, 2016

The latest newlib provides itoa too, also this function should be put under guards. Weird that the compiler doesn't throw errors on itoa, maybe because in this case the stub has the exact same signature as the lib function.

arm-none-eabi/include$ grep [iu]toa -r *
stdlib.h:char * _EXFUN(__itoa,(int, char *, int));
stdlib.h:char * _EXFUN(__utoa,(unsigned, char *, int));
stdlib.h:char * _EXFUN(itoa,(int, char *, int));
stdlib.h:char * _EXFUN(utoa,(unsigned, char *, int));

@cmaglie
Copy link
Member

cmaglie commented Oct 17, 2016

Fixed with #5480.
The implementation of itoa and utoa inside the Arduino core will be removed when the bundled arm-gcc will be upgraded.

@cmaglie cmaglie closed this Oct 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Waiting for feedback More information must be provided before we can proceed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants