How do I make Polyspace understand a dereferenced pointer function parameter?
조회 수: 1 (최근 30일)
이전 댓글 표시
The project I'm analyzing has functions that have dereferenced pointers as the parameters:
extern void func( Custom_Type &func_param );
where "Custom_Type" is a typedef-ed struct object. Lines like this give me a
extern void func( Custom_Type &func_param );
^ Expected a ")"
error in Polyspace (Bug Finder) in front of where the ampersand (&) is located. I was able to fix this error by changing the
&func_param --> * func_param
in place with the processing script option, but then that just leads to numerous errors complaining about types not matching (which makes perfect sense since the parameter type was changed).
Is there a way to inform Polyspace that the parenthesis it's expecting is at the end of the line and that the dereferenced pointer is valid?
댓글 수: 1
Chinmayi Lanka
2017년 1월 20일
The issue might be with the Custom_Type. Is the Custom_Type known to Polyspace?
채택된 답변
Alexandre De Barros
2017년 1월 24일
편집: Alexandre De Barros
2017년 1월 25일
Hello,
In C, this syntax
extern void func( Custom_Type &func_param );
is not valid.
I guess that you should use the C++ mode of Polyspace, because the & character in a declaration represents a reference in C++.
Best regards,
Alexandre
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Run Settings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!