Issue with verifying AUTOSAR software components by using Polyspace Code Prover, variable definitions are not considering from Rte_Type.h header file even if it included in source file.
古いコメントを表示
I am verifying Autosar swc by using Polyspace Code Prover, in that one source file is included with 'Rte_Type.h' all variables and structure defintions are defined in the 'Rte_Type.h' but while creating the project I am getting compilation errors like identifier 'Varianle_name' is undefined I can see in the log files,even include folder is having 'Rte_Type.h' file. So many times I am getting this error for different software components, I think this is a bug present in the polyspace code prover. Please fix this issue as soon as possible.
2 件のコメント
Anirban
2020 年 6 月 12 日
Hi Venkata,
It is possible you ran into a bug, but it might also be possible that there is an issue in setting up the project. In principle, an include file explicitly specified in the project should be visible to the Polyspace analysis.
To be able to understand the issue better, I would require to know how you are running Polyspace Code Prover.
If you are running at the command line, are you using:
- polyspace-autosar (https://www.mathworks.com/help/codeprover/ref/polyspaceautosarcommand.html)?
OR
- One of polyspace-bug-finder or polyspace-bug-finder-server?
If you are running from the user interface, when creating the project:
- Did you choose the option Create from AUTOSAR specification?
OR
- Did you add sources and includes manually to the project?
Depending on the answer, I might be able to point you to some resources for further troubleshooting or might even be able to tell what is happening. However, issues with AUTOSAR projects are often convoluted. You might get a faster answer if you contacted MathWorks Technical Support.
Venkata Narendra
2020 年 6 月 14 日
回答 (1 件)
Hi Venkata,
I can actually give a partial answer to your question.
There is a common user perception that if a header file is specified in a source file, the Polyspace analysis should knows its contents. That is somewhat true for standard headers. But even for standard headers, it might be better if you specify the path to your compiler version of the headers by using the -I option (or by just adding the header paths to the Project Include Folders if you are running analysis from the UI). The reason is that eventually you are compiling your code with those headers and you want the Polyspace analysis to emulate your compilation as closely as possible. As an aside, there is a command polyspace-configure that can extract the header paths from a build command or makefile without you having to explicitly dig them up.
However, for standard headers, Polyspace does know their contents and you do not necessarily have to specify folder paths to those headers using an analysis option. For instance, a simple file with stdio.h included will compile fine without your having to specify the path to your compiler version of stdio.h. Along the same lines, Rte_Type.h is a standard header too, but only in the AUTOSAR context. So:
- If you run a regular Code Prover analysis, say using polyspace-code-prover, you have to explicitly specify the folder paths to the AUTOSAR headers. Simply including them in source files will not work. If you know the folder paths to the AUTOSAR headers, you can take this approach.
- If you run the polyspace-autosar command, it is AUTOSAR-aware. You then do not have to specify the folder paths to AUTOSAR headers explicitly.
Hope this helps.
5 件のコメント
Venkata Narendra
2020 年 6 月 14 日
Anirban
2020 年 6 月 14 日
Hi Venkata,
There is one other suggestion I can give. Is Rte_Type.h directly in the source folder or a subfolder of the source folder? If the header is in a subfolder, you might have to specify the path to the subfolder explicitly. See more in this troubleshooting topic.
Enter the path to the subfolder in the field Specify additional include folders and see if the error goes away, and let us know if that was the underlying issue. Otherwise, Technical Support can diagnose the specific issue.
Venkata Narendra
2020 年 6 月 15 日
Hi Venkata,
I think it is better to contact Technical Support at this point. If you provide them the logs, they can help diagnose the specific issue. If the issue is indeed a bug, they can get back to development for a fix. You can point to this answer to save on some initial conversations.
Venkata Narendra
2020 年 6 月 17 日
カテゴリ
ヘルプ センター および File Exchange で Code Prover Analysis of AUTOSAR Code についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!