Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

Two or more incompatible declarations of the same function or object that appear in the same program shall be diagnosed because they result in undefined behavior.

Wiki MarkupThe C99 standard \[ [ISO/IEC 9899:1999|AA. Bibliography#ISO/IEC 9899-1999]\] identifies three distinct situations in which undefined behavior (UB) may arise as a result of incompatible declarations of the same function or object:

UB

Description

Code

14

Two declarations of the same object or function specify types that are not compatible (6.2.7).

All noncompliant code in this guideline.

34

An object has its stored value accessed other than by an lvalue of an allowable type (6.5).

Incompatible Object Declarations, Incompatible Array Declarations

39

A function is defined with a type that is not compatible with the type (of the expression) pointed to by the expression that denotes the called function (6.5.2.2).

Incompatible Function Declarations, Excessively Long Identifiers

...

Bibliography

...

\[[Hatton 1995|AA. Bibliography#Hatton 95]\] Section 2.8.3

...

DCL39-C. Avoid information leak in structure padding      02. Declarations and Initialization (DCL)      03. Expressions (EXP)