Why do I get a compilation error for a standard function stubbed by PolySpace?
7 ビュー (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2010 年 5 月 21 日
編集済み: MathWorks Support Team
2022 年 11 月 18 日
I am using a custom implementation of memcpy. So I included my own header file string.h to the analysis. However, when I try to start the analysis I get the following compilation error:
ERROR: Stubbing standard library functions ...
C-STUBS/__polyspace__stdstubs.c:2870: missing parameter 4 type
C-STUBS/__polyspace__stdstubs.c:2870: syntax error; found `n' expecting `)'
C-STUBS/__polyspace__stdstubs.c:2870: skipping `n'
C-STUBS/__polyspace__stdstubs.c:2871: conflicting redeclaration of `memcpy' previously declared at /cygdrive/c/PolySpace/work/string.h:1
C-STUBS/__polyspace__stdstubs.c:2880: undeclared identifier `n'
採用された回答
MathWorks Support Team
2022 年 11 月 18 日
編集済み: MathWorks Support Team
2022 年 11 月 18 日
Polyspace provides stubs for all standard library function like memcpy. If your implementation differs from that standard implementation then you might receive an error message like the one mentioned above.
In that case you can switch off the standard library stubbing for this particular function by adding the define
-D __polyspace_no_memcpy
to the analysis options. So Polyspace would either use your implementation of memcpy or it would stub the function based on the prototype you mention in the header file.
For details see page 7-53 (Linking: Conflict with Standard Library Function Stubs) in the Polyspace Code Prover User's Guide, which can be found online at
https://www.mathworks.com/help/pdf_doc/codeprover/codeprover_ug.pdf
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Bug Finder Analysis in Polyspace Platform User Interface についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!