Why would polyspace report "memset is dead code"

6 ビュー (過去 30 日間)
Tommy
Tommy 2014 年 8 月 7 日
回答済み: Alexandre De Barros 2014 年 8 月 13 日
After the "Intermediate" part is done, the Full Log shows
memset is dead code
(along with other Standard C functions). I am using memset in many places and have not stubbed it myself. What can I do to make these messages go away? This is with R2013a.
I understand what dead code is and that polyspace does report any unused function of mine as dead code. But why would it report Standard C functions as dead? I'm puzzled...
  2 件のコメント
Iain
Iain 2014 年 8 月 7 日
Maybe there is a call to memset that cannot be reached due to a logic error in an if or while statement?
Tommy
Tommy 2014 年 8 月 8 日
@Iain: My understanding is that this would be a case of "unreachable" code, marked as a gray UNR. Dead code usually means "This function isn't called anywhere; it can be eliminated." With several non-gray calls, memset can't be dead code.

サインインしてコメントする。

採用された回答

Alexandre De Barros
Alexandre De Barros 2014 年 8 月 13 日
Hello!
For performance and precision reasons, Polyspace is creating inner versions of memset (and also other memory related functions) and actually calling these versions, even if you don't see it in the results. Hence, the "original" version of memset is not called. This internal information appears in the log, but should be ignored.
Alex

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangePolyspace Code Prover についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by