Polyspace MISRA C 2012 rule 8.6 inquiry
조회 수: 11 (최근 30일)
이전 댓글 표시
The polyspace bug finder with MISRA C 2012 showing 8.6 violations even though only one definition is available in .c file.
Polyspace configurations are: compiler visual 11.0, target mpc5xx
Result Details:
" MISRA C:2012 8.6 (Required)
An identifier with external linkage shall have exactly one external definition.
undefined global variable 'os_config_pwm_func_call' "
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1334480/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1334485/image.png)
댓글 수: 0
답변 (1개)
Anirban
2023년 3월 24일
Which release of Polyspace are you using?
I am asking because in later releases, the results for rules 8.x should appear with an event traceback showing the two instances that lead to the violation. If you do see the traceback, can you send a screenshot of the Result Details window? That might help us confirm that the violation is because of the two instances you are showing here.
Also, the violation does not show up in this simple reproduction:
header.h :
#define unsigned16_t unsigned short
extern unsigned16_t os_config_pwm_func_call;
file.c :
#include "header.h"
unsigned16_t os_config_pwm_func_call;
Therefore, something else might be happening here. If you cannot understand the violation in your example, please contact MathWorks Technical Support for further help with the problem.
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Bug Finder Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!