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

Confusing overflow error messages in printf #464

Open
skejeton opened this issue Jan 3, 2025 · 0 comments
Open

Confusing overflow error messages in printf #464

skejeton opened this issue Jan 3, 2025 · 0 comments
Labels
enhancement New feature or request

Comments

@skejeton
Copy link
Contributor

skejeton commented Jan 3, 2025

fn main() {
    x := 0xABCDEF123
    printf("%x\n", x)
}

expected output: printf type error because int64 doesn't fit into uint32
output: overflow of uint32

fn main() {
    x := 1e142
    printf("%f\n", x)
}

expected output: printf type error because real doesn't fit into real32
output: overflow of real32

@vtereshkov vtereshkov changed the title Confusing overflow errors. Confusing overflow error messages in printf Jan 3, 2025
@vtereshkov vtereshkov added the enhancement New feature or request label Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants