misra: Fix false positives for rule 8.2 (#3311)
Reported in the forum: https://sourceforge.net/p/cppcheck/discussion/development/thread/801dc07e59/?page=1&limit=25#a1a8
This commit is contained in:
parent
6432922c76
commit
62dbe2eb2f
|
@ -1530,8 +1530,7 @@ class MisraChecker:
|
||||||
self.reportError(typeStartToken, 8, 2)
|
self.reportError(typeStartToken, 8, 2)
|
||||||
|
|
||||||
# Type declaration on next line (old style declaration list) is not allowed
|
# Type declaration on next line (old style declaration list) is not allowed
|
||||||
if ((typeStartToken.linenr > endCall.linenr) or
|
if typeStartToken.linenr > endCall.linenr:
|
||||||
(typeStartToken.column > endCall.column)):
|
|
||||||
self.reportError(typeStartToken, 8, 2)
|
self.reportError(typeStartToken, 8, 2)
|
||||||
|
|
||||||
# Check arguments in function declaration
|
# Check arguments in function declaration
|
||||||
|
|
|
@ -327,10 +327,17 @@ void misra_8_2_m(uint8_t * const x)
|
||||||
int16_t ( *misra_8_2_p_a ) (); // 8.2
|
int16_t ( *misra_8_2_p_a ) (); // 8.2
|
||||||
int16_t ( *misra_8_2_p_b ) (void);
|
int16_t ( *misra_8_2_p_b ) (void);
|
||||||
int16_t ( *misra_8_2_p_c ) (int);
|
int16_t ( *misra_8_2_p_c ) (int);
|
||||||
int misra_8_2_no_fp (int a)
|
int misra_8_2_n(int a)
|
||||||
{
|
{ return a + 42; }
|
||||||
return a + 42;
|
int misra_8_2_o(
|
||||||
}
|
const uint32_t a1,
|
||||||
|
const uint8_t *const a2
|
||||||
|
)
|
||||||
|
{ return *a2 + a1; }
|
||||||
|
int misra_8_2_p(
|
||||||
|
const uint32_t a1,
|
||||||
|
const uint8_t *const a2
|
||||||
|
);
|
||||||
|
|
||||||
extern int a811[]; // 8.11
|
extern int a811[]; // 8.11
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue