MISRA C:2012 Rule 1.2
Language extensions should not be used
Description
Rule Definition
Language extensions should not be used1 .
Rationale
If a program uses language extensions, its portability is reduced. Even if you document the language extensions, the documentation might not describe the behavior in all circumstances.
Polyspace Implementation
The rule checker flags these language extensions, depending on the version of the C standard
used in the analysis. See C standard
version (-c-version)
.
C90:
long long int
type including constantslong double
typeinline
keyword_Bool
keywordHexadecimal floating-point constants
Designated initializers
Local label declarations
typeof
operatorCasts to union
Compound literals
Statements and declarations in expressions
__func__
predefined identifier_Pragma
preprocessing operatorMacros with variable arguments list
asm
functionsAnonymous unions
Empty
struct
C99:
short long int
typeLocal label declarations
typeof
operatorCasts to union
Statements and declarations in expressions
asm
functionsAnonymous unions
Empty
struct
Troubleshooting
If you expect a rule violation but do not see it, refer to Diagnose Why Coding Standard Violations Do Not Appear as Expected.
Check Information
Group: Standard C Environment |
Category: Advisory |
AGC Category: Advisory |
Version History
Introduced in R2014bSee Also
1 All MISRA coding rules and directives are © Copyright The MISRA Consortium Limited 2021.
The MISRA coding standards referenced in the Polyspace Bug Finder™ documentation are from the following MISRA standards:
MISRA C:2004
MISRA C:2012
MISRA C:2023
MISRA C++:2008
MISRA C++:2023
MISRA and MISRA C are registered trademarks of The MISRA Consortium Limited 2021.