uint64_t types in PIMeval and PIMbench are currently being printed using format specifiers like %lld or %lu. While some compilers handle this without warnings, others produce warnings due to incorrect format specifiers for uint64_t. To ensure portability and avoid such warnings, the recommended approach is to use the <cinttypes> header and print using:
printf("%" PRIu64 "\n", value);
This ensures the code is portable across different platforms and compilers, which may have different representations for uint64_t.
Proposed Solution:
- Replace all occurrences of
%lld or %lu used for uint64_t with %" PRIu64 " as defined in <cinttypes>.
- Ensure that
<cinttypes> is included wherever uint64_t is printed.
Reference:
- https://en.cppreference.com/w/c/types/integer#Format_macro_constants
uint64_ttypes in PIMeval and PIMbench are currently being printed using format specifiers like%lldor%lu. While some compilers handle this without warnings, others produce warnings due to incorrect format specifiers foruint64_t. To ensure portability and avoid such warnings, the recommended approach is to use the<cinttypes>header and print using:This ensures the code is portable across different platforms and compilers, which may have different representations for
uint64_t.Proposed Solution:
%lldor%luused foruint64_twith%" PRIu64 "as defined in<cinttypes>.<cinttypes>is included whereveruint64_tis printed.Reference: