-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Built-in printf
truncates integers to 32-bit
#3352
Comments
Indeed. Should output
|
FWIW it'll still occur if one fixes up to the templates to be: template <>
intmax_t raw_string_to_scalar_type(const wchar_t *s, wchar_t **end) {
return wcstoimax(s, end, 0);
}
template <>
uintmax_t raw_string_to_scalar_type(const wchar_t *s, wchar_t **end) {
return wcstoumax(s, end, 0);
} (there was a change to accommodate FreeBSD 8: #626 - changing the types back is still the right thing to do, I think. FreeBSD seems to have fixed their headers.) |
The problem is that we're not using int64_t and uint64_t types for ints. The GNU
To be compatible we should be using |
Heh, does GNU printf do this when compiled in 32 bit mode? (Answer: yes!) I don't understand the suggestion to switch from |
It looks to me like the problem is that we are constructing a format string (in |
It turns out this is a very prosaic bug. As @ridiculousfish guessed the core problem is that the Having said that I am still very unhappy about the assumption that |
sh -c 'env HOME=$(mktemp -d) fish'
)?fish version installed (
fish --version
):2.3.1
OS/terminal used:
macOS, Terminal
Integers to the built-in
printf
are truncated to 32 bit.Reproduction steps
printf "%#x\\n" 498216206596
Expected results
Actual results
The text was updated successfully, but these errors were encountered: