misra: Improve warning messages for rule 8.2 when the missing arguments are on the next line (#3320)
This makes it easier for the user to find the violation. Suggested in the forum: https://sourceforge.net/p/cppcheck/discussion/development/thread/801dc07e59/#a1a8/d3e9/c455/8915/747c/2525/0eb8/0f7d
This commit is contained in:
parent
9be88a06fe
commit
426117a30d
|
@ -1500,6 +1500,9 @@ class MisraChecker:
|
|||
break
|
||||
voidArg = voidArg.next
|
||||
if not voidArg.str == 'void':
|
||||
if func.tokenDef.next:
|
||||
self.reportError(func.tokenDef.next, 8, 2)
|
||||
else:
|
||||
self.reportError(func.tokenDef, 8, 2)
|
||||
|
||||
def checkDeclarationArgumentsViolations(func, startCall, endCall):
|
||||
|
@ -1528,6 +1531,9 @@ class MisraChecker:
|
|||
startCall = startCall.next
|
||||
|
||||
if len(argNameTokens) != foundVariables:
|
||||
if func.tokenDef.next:
|
||||
self.reportError(func.tokenDef.next, 8, 2)
|
||||
else:
|
||||
self.reportError(func.tokenDef, 8, 2)
|
||||
|
||||
def checkDefinitionArgumentsViolations(func, startCall, endCall):
|
||||
|
|
|
@ -354,6 +354,8 @@ int misra_8_2_p(
|
|||
const uint32_t a1,
|
||||
const uint8_t *const a2
|
||||
);
|
||||
int misra_8_2_q
|
||||
(); // 8.2
|
||||
|
||||
extern int a811[]; // 8.11
|
||||
|
||||
|
|
Loading…
Reference in New Issue