Skip to content
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

String((unsigned int)1) crashes with pc/1.0.2 #15

Closed
jml3on opened this issue Aug 14, 2018 · 2 comments
Closed

String((unsigned int)1) crashes with pc/1.0.2 #15

jml3on opened this issue Aug 14, 2018 · 2 comments

Comments

@jml3on
Copy link

jml3on commented Aug 14, 2018

Using the following code under a blink project in local debug mode.

void setup() {}

void loop() {
  String t((unsigned int)1);
}

That program crashes when run in local mode.
It works fine when removing the unsigned qualifier.

Under debugger, it appears that calling from String(unsigned int)

char *utoa (unsigned char __val, char *__s, unsigned char __radix)
{
	return utoa ((unsigned int) __val, __s, (int) __radix);
}

loops for ever.

This is because utoa is not defined in stdlib.h, like itoa` is:

_CRTIMP __cdecl __MINGW_NOTHROW  char* itoa (int, char*, int);

not sure what a proper fix is, as I'm not sure if this is a mingw or jantje issue.

@jantje
Copy link
Owner

jantje commented Aug 14, 2018

not sure what a proper fix is, as I'm not sure if this is a mingw or jantje issue.

I don't know and I wont have time to look at it before half september.

@jml3on
Copy link
Author

jml3on commented Aug 15, 2018

this older issue seems relevant: esp8266/Arduino#110

It is indeed the case that ArduinoIDE has a modified stdlib under C:\Program Files (x86)\Arduino\hardware\tools\avr\avr\include that contains utoa.

So it's not a mingw issue, it should either be fixed in jantje or sloeber.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants