Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

THIS IS THE VOID SECTION, ITS CONTENTS ARE NOT INTENDED TO BE PART OF THE SECURE CODING STANDARDS.

By definition, the types The C99 intmax_t and uintmax_t types are capable of representing any value representable by any other types of the same signedness.  By using these types, the danger of truncation associated with the ambiguities of a change in platform or architecture, e.g. IA-32 to x86-64, can be mitigated.

Code Block

printf ("request is %" PRIuMAX "\n", (uintmax_t) sym->st_value);

Formatted input and output functions contain a length modifier which provides the above facilities for input/output.  The j specifier in a format string indicates that the following d, i, o, u, x, X, or n conversion specifier will apply to an argument with type pointer to intmax_t or uintmax_t.

Wiki Markup
\[[ISO/IEC 9899-1999|AA. C References#ISO/IEC 9899-1999]] Section 7.19.6, "Formatted input/output functions," and Section 7.18.1.5, "Greatest-width integer types"