Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: minor editorial changes

...

In this noncompliant code example, the variable i is declared to have the type int in file a.c but defined to be of the type short in file b.c. The declarations are incompatible, resulting in undefined behavior 15. Furthermore, accessing the object using an lvalue of an incompatible type, as shown in function f(), is undefined behavior 37 with possible observable results ranging from unintended information exposure to memory overwrite to a hardware trap.

...

In this noncompliant code example, the variable a is declared to have a pointer type in file a.c but defined to have an array type in file b.c. The two declarations are incompatible, resulting in undefined behavior 15. As before, accessing the object in function f() is undefined behavior 37 with the typical effect of triggering a hardware trap.

...

...