How to ignore link errors during polyspace analysis of C Project.......??

Using Code prover R2014b for C++ project ignore link errors option is given but for C project not there...
Link errors have been detected in the code. ---
Please correct them and launch the analysis again. ---
--- ---
-------------------------------------------------------------------

 Accepted Answer

Hi,
There is indeed an option, available in the C++ product, to ignore some link errors. This option is -no-extern-C.
This option is present in the C++ product because some functions may be declared inside an extern “C” { } block in some files and not in others. Then, their linkage is not the same and it causes a link error, according to the ANSI standard.
Those link errors can then be bypassed by using this option, but the goal is not to bypass all link errors. When you have other kinds of link errors in C++ or in C, they have to be fixed, as the message said. They are indeed real problems in the code.
Typically, a link error occurs when you have something like:
one_file.c:
int x;
another_file.c:
float x;
As you can imagine, Polyspace cannot prove anything on x if its type is not clearly defined. There is something wrong in the definition of x, that needs to be fixed. Consider the link errors given by Polyspace Code Prover as bugs.
By the way, Polyspace Bug Finder provide a specific defect for this link errors: DECLARATION_MISMATCH.
Alex

4 Comments

Hi alex, It means there is no option for ignoring link errors in Polyspace R2014b code prover for C projects. We do have to resolve them first then analysis is possible...??? Then this will really be a tough task to perform analysis on big projects... :(
Hello,
Keep in mind that the link errors are given by Polyspace because there are genuine definition problems in the code.
I don't know how many link errors you have but to go faster, I suggest you to use the Bug Finder and select only the "Declaration Mismatch" defect, so you can see them in the Polyspace interface and use its browsing capabilities to resolve them.
Alex
Thanks alex... problem solved with your suggestion...:)
Hello Alex ,
where can I find that Polyspace Bug Finder provide a specific defect for this link errors: DECLARATION_MISMATCH ? Can you provide me with that source information
thank you

Sign in to comment.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!