Polyspace Code Prover expected identifier error
2 ビュー (過去 30 日間)
古いコメントを表示
Hello,
I have been getting familiar with Polyspace tools but have encountered the following error while trying to analyse my project with Polyspace Code Prover (2016b).
In an include file (that I have already added to the Polyspace project) I have this struct definiton:
typedef struct
{
/* Pointer to actual data */
KeyBaseType * data;
/* Additional information */
VoidPtrType context;
}KeyType
The files where KeyBaseType and VoidPtrType are defined, are also included.
The problem I have encountered is that Polyspace yields this error when it tries to compile:
Error: expected an identifier
KeyBaseType * ;
^
Any idea about why is this happening or what would be a work around is much appreciated.
0 件のコメント
回答 (1 件)
Anirban
2019 年 11 月 1 日
This error can come from multiple causes. Without some indication of the definition of KeyBaseType, it is difficult to answer.
But the fact that 'data' is removed from the error message gives some clue. Are you using the Keil or IAR compiler by any chance? 'data' is a keyword in those compilers. See for instance: http://www.keil.com/support/man/docs/c51/c51_le_keywords.htm
Polyspace removes a bunch of what it considers as keywords during preprocessing since they are not relevant for the analysis: https://www.mathworks.com/help/bugfinder/ug/verify-keilor-iar-dialects.html
To use 'data' as an identifier, see: https://www.mathworks.com/help/bugfinder/ug/keiliar-keywords-removed.html
Alternatively, you can just rename 'data' to something else.
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!