Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: INT36-EX2

...

INT36-EX2: Any valid pointer to void can be converted to intptr_t or uintptr_t and back with no change in value. This exception includes , including the underlying types if types.  Use of types other than intptr_t and or uintptr_t are typedefs, and any typedefs that denote the same types as intptr_t and uintptr_t is discouraged, however, because it limits portability.

Code Block
bgColor#ccccff
langc
#include <assert.h>
 
void h(void) {
  intptr_t i = (intptr_t)(void *)&i;
  uintptr_t j = (uintptr_t)(void *)&j;
 
  void *ip = (void *)i;
  void *jp = (void *)j;
 
  assert(ip == &i);
  assert(jp == &j);
}

...