-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
Checklist
- Checked the issue tracker for similar issues to ensure this is not a duplicate
- Read the documentation to confirm the issue is not addressed there and your configuration is set correctly
- Tested with the latest version to ensure the issue hasn't been fixed
How often does this bug occur?
always
Expected behavior
I expected there to be a way to print a uint64_t in hexadecimal using the <stdio.h> function printf.
GCC refuses to compile if I do not use the %llx format specifier, as in printf("%llx\n", the_integer_variable).
Similarly, I should be able to use the PRIx64 macro from <inttypes.h> like printf("%" PRIx64 "\n", the_integer_variable). This macro appears to expand to the same string.
Actual behavior (suspected bug)
Attempting to use %llx as a format specified will print lx verbatim.
It also seems to somehow corrupt the argument list: printf("%llx %d", <a uint64_t variable of value 100 (decimal)>, 5) prints lx 1073652028.
Error logs or terminal output
(n/a)Steps to reproduce the behavior
- Create a project (e.g. by copying an example)
- Add the necessary header files
- Declare and initialize a variable of type
uint64_t - Attempt to use that variable as a parameter to
printf
Project release version
latest master (858c7c2)
System architecture
Intel/AMD 64-bit (modern PC, older Mac)
Operating system
Linux
Operating system version
Debian 12 (bookworm)
Shell
Bash
Additional context
I'd assume this to be a problem with the libc used, I would not know where to open an issue for that if not here.