MISRA C:2023 Rule 8.1
Description
Rule Definition
Types shall be explicitly specified.
Rationale
In some circumstances, you can omit types from the C90 standard. In those cases, the
int
type is implicitly specified. However, the omission of an
explicit type can lead to confusion. For example, in the declaration extern
void foo (char c, const k);
, the type of k
is
const int
, but you might expect const
char
.
You might be using an implicit type in:
Object declarations
Parameter declarations
Member declarations
typedef
declarationsFunction return types
Polyspace Implementation
The rule checker flags situations where a function parameter or return type is not explicitly specified.
Troubleshooting
If you expect a rule violation but do not see it, refer to Diagnose Why Coding Standard Violations Do Not Appear as Expected.
Examples
Check Information
Group: Declarations and Definitions |
Category: Required |
AGC Category: Required |
Version History
Introduced in R2024a