Skip to content

Commit 336493f

Browse files
Checks: Added new MISRA04_8.2: Whenever an object or function is declared or defined, its type shall be explicitly stated [autosync]
1 parent d2f937c commit 336493f

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

CodeCheck/clang/misra.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,19 @@
556556
]
557557
}
558558
},
559+
"MISRA04_8.2": {
560+
"tags": ["Language: C", "Standard: MISRA C 2004", "Category: Required", "Types"],
561+
"key": "implicit-int",
562+
"name": "Published Standards/MISRA-C 2004/8.2 Whenever an object or function is declared or defined, its type shall be explicitly stated",
563+
"test": "CPP_T050",
564+
"desc": {
565+
"html": [
566+
"<p>Whenever an object or function is declared or defined, its type shall be explicitly stated.</p>",
567+
"<p><b>Example</b></p>",
568+
"<pre><code language=\"C\">extern x; /* Non-compliant */\nextern int16_t x; /* Compliant */\nconst y; /* Non-compliant */\nconst int16_t y; /* Compliant */\nstatic foo(void); /* Non-compliant */\nstatic int16_t foo(void); /* Compliant */</code></pre>"
569+
]
570+
}
571+
},
559572
"MISRA12_8.1": {
560573
"tags": ["Language: C", "Standard: MISRA C 2012", "Category: Required", "Types"],
561574
"key": "implicit-int",

0 commit comments

Comments
 (0)