Fix #12172:False positive: misra-11.1 function pointer assigned to array (#5667)
This commit is contained in:
parent
682901ac2a
commit
1ce901385a
|
@ -647,7 +647,8 @@ def get_function_pointer_type(tok):
|
||||||
ret += '('
|
ret += '('
|
||||||
tok = tok.next.next
|
tok = tok.next.next
|
||||||
while tok and (tok.str not in '()'):
|
while tok and (tok.str not in '()'):
|
||||||
ret += ' ' + tok.str
|
if tok.varId is None:
|
||||||
|
ret += ' ' + tok.str
|
||||||
tok = tok.next
|
tok = tok.next
|
||||||
if (tok is None) or tok.str != ')':
|
if (tok is None) or tok.str != ')':
|
||||||
return None
|
return None
|
||||||
|
|
|
@ -779,6 +779,13 @@ static void misra_10_8(u8 x, s32 a, s32 b) {
|
||||||
int (*misra_11_1_p)(void); // 8.4
|
int (*misra_11_1_p)(void); // 8.4
|
||||||
void *misra_11_1_bad1 = (void*)misra_11_1_p; // 11.1 8.4
|
void *misra_11_1_bad1 = (void*)misra_11_1_p; // 11.1 8.4
|
||||||
|
|
||||||
|
// #12172
|
||||||
|
typedef void (*pfFunc_11_1)(uint32_t some);
|
||||||
|
extern pfFunc_11_1 data_11_1[10];
|
||||||
|
void func_11_1(pfFunc_11_1 ptr){ //8.4
|
||||||
|
data_11_1[index] = ptr; // no-warning
|
||||||
|
}
|
||||||
|
|
||||||
struct misra_11_2_s;
|
struct misra_11_2_s;
|
||||||
struct misra_11_2_t;
|
struct misra_11_2_t;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue