...
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.
...
In this noncompliant code example, the length of the identifier declaring the function pointer bash_groupname_completion_function()
in the file bashline.h
exceeds by 3 the minimum implementation limit of 31 significant initial characters in an external identifier. This introduces the possibility of colliding with the bash_groupname_completion_funct
integer variable defined in file b.c
, which is exactly 31 characters long. On an implementation that exactly meets this limit, this is undefined behavior 31. It results in two incompatible declarations of the same function. (see See undefined behavior 15.) . In addition, invoking the function leads to undefined behavior 41 with typically catastrophic effects.
...