How can I use dynamic arrays in Polyspace 5.1 (R2008a)?
조회 수: 1 (최근 30일)
이전 댓글 표시
Dynamic arrays are possible in C with compilers supporting the C99 standard.
PolySpace supports only C90 so an analysis using this construct will fail with a compilation error.
채택된 답변
MathWorks Support Team
2011년 12월 28일
There is no way to make PolySpace accept dynamic arrays without modifying the source code that is being analyzed.
Please consider the following:
Replace this syntax
void foo(unsigned char a)
{
char b[a];
}
with this
void foo(unsigned char a)
{
#ifndef POLYSPACE
char b[a];
#else
char *b = (char *) malloc(sizeof(char) * a);
#endif
}
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Troubleshoot Compilation Errors에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!