MISRA C:2023 Rule 1.2
Language extensions should not be used
Since R2024a
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 inttype including constantslong doubletypeinlinekeyword_BoolkeywordHexadecimal floating-point constants
Designated initializers
Local label declarations
typeofoperatorCasts to union
Compound literals
Statements and declarations in expressions
__func__predefined identifier_Pragmapreprocessing operatorMacros with variable arguments list
asmfunctionsAnonymous unions
Empty
struct
C99:
short long inttypeLocal label declarations
typeofoperatorCasts to union
Statements and declarations in expressions
asmfunctionsAnonymous 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 R2024aSee 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.