Skip to content

Bugfix for various strtol/strtoll issues - #1209

Closed
sbalko wants to merge 5 commits into
emscripten-core:incomingfrom
sbalko:incoming
Closed

Bugfix for various strtol/strtoll issues #1209
sbalko wants to merge 5 commits into
emscripten-core:incomingfrom
sbalko:incoming

Conversation

@sbalko

@sbalko sbalko commented May 25, 2013

Copy link
Copy Markdown
Contributor

This fixes a number of issues in the existing strtoll/strtol (and variants) implementation. Notably, this fixes issues when trying to parse hex numbers (0x...) with an undefined (=0) base where strtoll/strtol will (according to spec) resort to the string representation to identify the base.

A number of test cases for various bases (2, 8, 10, 16) is included.

Generally, we experience these sort of issues in "corner cases" fairly often with the existing stdlib implementation in library.js. In light of asm.js being so fast, I wonder whether emscripten wouldn't be better of by replacing most of that with an existing C library which has matured over time?

@kripken

kripken commented May 28, 2013

Copy link
Copy Markdown
Member

I am hoping we will investigate porting an existing libc in the near future, yeah, definitely worth doing.

@kripken

kripken commented May 28, 2013

Copy link
Copy Markdown
Member

Can you please rebase to remove the merge commits (and preferably also the dummy commit)?

@sbalko

sbalko commented May 29, 2013

Copy link
Copy Markdown
Contributor Author

Done!

@kripken

kripken commented May 29, 2013

Copy link
Copy Markdown
Member

Thanks. I also meant to also get rid of the other dummy commits, but I'll do that locally.

@kripken

kripken commented May 29, 2013

Copy link
Copy Markdown
Member

Rebased and merged to incoming. Thanks!

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

Successfully merging this pull request may close these issues.

2 participants