Versions Compared

Key

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

...

A similar scheme was used in early versions of Emacs, limiting its portability and preventing the ability to edit files larger than 8MB.

Please note that this non-compliant code example also violates EXP11-A. Do not apply operators expecting one type to data of an incompatible type.

Compliant Solution

Saving a few bits of storage is generally not as important as writing portable code. A struct can be used to provide room for both the pointer and the flag value.  This is portable to machines of different word sizes, both smaller and larger than 32 bits, and works even when pointers cannot be represented in any integer type.

...