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!