Skip to content

PIMeval & PIMbench: Improving Portablity of Print Statements #188

Description

@fasiddique

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:

  1. https://en.cppreference.com/w/c/types/integer#Format_macro_constants

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions