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

GCC: atoi + printf does not work when linking with ucrt #192

Open
Blackhex opened this issue Sep 9, 2024 · 0 comments
Open

GCC: atoi + printf does not work when linking with ucrt #192

Blackhex opened this issue Sep 9, 2024 · 0 comments
Assignees

Comments

@Blackhex
Copy link
Member

Blackhex commented Sep 9, 2024

Repro case:

  • Build the toolchain with ucrt.
  • Compile with aarch64-w64-mingw32-gcc atoi.c
// atoi.c
#include <stdlib.h>
#include <stdio.h>

int main() {
  int test = atoi("20");
  printf("%d\n", test);
}
  • Run ./a.out.
  • Prints random integer, e.g., -385877008, instead of 20.

Notes:

@Blackhex Blackhex self-assigned this Jan 5, 2025
@Blackhex Blackhex changed the title atoi + printf does not work when linking with ucrt GCC: atoi + printf does not work when linking with ucrt Jan 27, 2025
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

1 participant