Skip to content

fix(libc): return positive zero when float parsing consumes no input - #3905

Merged
oneandonlydean merged 3 commits into
boykopovar:mainfrom
aureau:aureau/carry-libc-strtod-no-conversion-zero
Oct 12, 2026
Merged

oneandonlydean merged 3 commits into
boykopovar:mainfrom
aureau:aureau/carry-libc-strtod-no-conversion-zero

Conversation

@aureau

@aureau aureau commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

What

Fixes #3090. On Windows, floating-point conversions can return negative zero when they consume no input. Return positive zero in that case while preserving valid negative-zero conversions and the end pointer’s behavior.

Adds regression coverage for the narrow and wide conversion functions. This carries forward work from #2725 and #3613, rebased onto current main and shared by @ArekatlaNishanthchowdary. The original commit authorship is preserved. The earlier PRs closed for administrative reasons.

Tested

  • Windows host unit-test build
  • guest_math, guest_strings, and guest_wide_strings: passed five consecutive runs with the fix
  • Regression comparison: guest_math failed against the original Strings.cpp; all three focused tests passed with the fix
  • tools/check_conventions.py --base origin/main: passed
  • Full CTest: 99% passed; 5 failures and 5 skipped out of 836 tests. Failures: guest_kernel_sys, windows_exceptions, agc_driver_emulated_color_compare, agc_driver_sampled_cache_budget, and guest_filesystem
  • Follow-up: agc_driver_sampled_cache_budget passed five consecutive reruns
  • Linux: Not run
  • No title or homebrew run

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); no silent stubs added
  • No notes, investigation .md files, or images added to the repository
  • New third-party code is a submodule built from source (no third-party code added)
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

libc: strtod, strtof, strtold and the wide variants return -0.0 when a sign is not followed by a number, where FreeBSD returns +0.0

3 participants