Is the QCC compiler from QNX supported by Polyspace?

31 次查看(过去 30 天)
I would like to use the QCC compiler (from QNX) but QCC does not appear in the list of compilers supported by Polyspace :
https://www.mathworks.com/help/bugfinder/ref/compilercompiler.html

采纳的回答

MathWorks Support Team
MathWorks Support Team 2024-11-15,0:00
编辑:MathWorks Support Team 2024-11-15,19:28
From R2020a version
QNX's qcc compiler is based on gcc (see
) and is then officially supported by polyspace-configure, the tool used to create a Polyspace project or options file based on the build command.
It means that polyspace-configure is able to recognize qcc as a compiler and is using gnuN.x (gnu7.x. gnu8.x...) for the -compiler option.
Now, even if a manual setup is possible, we recommend using polyspace-configure if you are building an application with the qcc compiler.
If using polyspace-configure is not possible, then use gnu7.x for the compiler in your Polyspace project and provided all the required QNX header files in your Polyspace project.
Even if qcc is based on gcc, it is using several flags to tune extra options of gcc. Many improvements have been made since R2020a to handle those extra options. It is then recommended to use the last version of polyspace-configure.
About using polyspace-configure :
If you are using polyspace-configure for the first time, you can try polyspace-configure on a small example.
Create the following file main.c:
#include <stdio.h>
int main(void){   printf("Hello World\n");}
Then launch polyspace-configure on this example:
<polyspaceroot>/bin/polyspace-configure.exe -allow-overwrite -output-project my.psprj <absolute-path-to>qcc.exe main.c
You can then launch a Polyspace Bug Finder analysis on the project my.psprj
Before R2020a
You can create your own polyspace-configure configuration file from the existing gcc.xml.
  • make a copy of <Polyspace Installation Folder>\polyspace\configure\compiler_configuration\gcc.xml and rename it qcc.xml.
  • edit this file, and change the line 5 with:   
<name>(.*-)?([cq]\+\+|q?cc)(-.+)?</name>
You can then use it like this: 
polyspace-configure -compiler-configuration <absolute-path-to>\qcc.xml ...
This command will create a project (.psprj) or an options file, depending on the options used with your command.
But you need to add the macro __QNX__ and undefined the macro __EDG__ in your project/options file.
In the project file, add these two macros by adding these lines 
 
<polyspace_c_extra_options_list><opt>-D __QNX__</opt><opt>-U __EDG__</opt></polyspace_c_extra_options_list><polyspace_cpp_extra_options_list><opt>-D __QNX__</opt><opt>-U __EDG__</opt></polyspace_cpp_extra_options_list>
In the options file, add these two lines:
-D __QNX__-U __EDG__

更多回答(0 个)

标签

尚未输入任何标签。

Community Treasure Hunt

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

Start Hunting!

Translated by