Skip to content

Misra 17.3 checks finds implicit function calls#7327

Merged
danmar merged 6 commits into
cppcheck-opensource:mainfrom
wienans:feature/misra-17-3
May 12, 2025
Merged

Misra 17.3 checks finds implicit function calls#7327
danmar merged 6 commits into
cppcheck-opensource:mainfrom
wienans:feature/misra-17-3

Conversation

@wienans
Copy link
Copy Markdown
Contributor

@wienans wienans commented Feb 23, 2025

I am not sure why the misra check for 17.3 was reduced to while and if statements but i think that shouldn't be the case.

Now it should detect more / all functions which are implicitly called.

I had a bit of a issue with function pointer defintion as the tokens

int16_t ( * misra_8_2_p_a ) ()

cause the detection to trigger on the int16_t. But i filtered these false function pointer detection's explicitly.

I also updated the test with the expected errors. As C89 is used i needed to add more expected 17.3 as needed.

  • printf_s
  • UINT32_C
  • va_copy

are all not present in C89. But even if we bump up to C11 this PR #7325 would need to be merged before hand to actually get all the needed Identifiers.

@wienans
Copy link
Copy Markdown
Contributor Author

wienans commented Mar 1, 2025

@danmar @firewave
Review would be nice

@wienans wienans force-pushed the feature/misra-17-3 branch from e045bcc to 4d160cf Compare March 9, 2025 11:04
Comment thread addons/test/misra/misra-test.c
Comment thread addons/test/misra/misra-test.c
@danmar
Copy link
Copy Markdown
Collaborator

danmar commented May 10, 2025

@wienans very sorry that it took so long for the review. this is way too long. :-(

@wienans wienans force-pushed the feature/misra-17-3 branch from 4d160cf to 1c5165a Compare May 10, 2025 15:33
@wienans
Copy link
Copy Markdown
Contributor Author

wienans commented May 10, 2025

@danmar rebased the branch for possible merge if my answeres to the questions where good enough to accept it.

@danmar danmar merged commit 6385105 into cppcheck-opensource:main May 12, 2025
53 checks passed
@wienans wienans deleted the feature/misra-17-3 branch May 12, 2025 14:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants