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.
The 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: Wiki Markup
UB | Description | Code |
---|---|---|
Two declarations of the same object or function specify types that are not compatible (6.2.7). | All noncompliant code in this guideline. | |
An object has its stored value accessed other than by an lvalue of an allowable type (6.5). | Incompatible Object Declarations, Incompatible Array Declarations | |
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 |
...
- ARR31-C. Use consistent array notation across all source files
- ISO/IEC 9899:1999 Section 6.7.5.2, "Array declarators," and Section 6.2.2, "Linkages of 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)