Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12612 Discussions

Pc-Lint setup to lint NIOS2 program

Mikkie
Beginner
255 Views

I have some software application that I wish to use Pc-lint plus from Vector(previously Gimpel) to perform static analysis.

 

Has anyone done a set up like this before? that is, created the required co-nios2-elf-gcc.lnt (compiler config), the macro export and include.lnt files?

 

When i follow the procedure to create  the macros, I gent a fairly sensible list of macros and the same for the include files (shown below), however when i try to run the linting, i get weird errors that makes me think all is not included yet.

I will attach some files in case anyone wishes to try it as well:

NIOS_LIN.BAT --> batch file to lint (with correct options) the test.c file (renamed to nios_lin.txt)

test.c --> very simple c source file for testing

nios_std.lnt --> top level lnt file to pull in other options

  • co-nios2-elf-gcc.lnt
  • nios_include.lnt
  • options.lnt -si4 -sp4

co-nios2-elf-gcc.lnt --> compiler config file

co-nios2-elf-gcc.h --> compiler header file

nios_include.lnt --> include path to std libraries

nios2_lint_cmac.h --> header file with the extracted macros.

NOTE: remove the .txt extensions from the attached files

The output of the execution is:

 

 

 

 

c:\lint>"C:\lint\Lint-nt"  +v  nios_std.lnt test.c
PC-lint for C/C++ (NT) Vers. 9.00a, Copyright Gimpel Software 1985-2008
--- Module:  --- Module:   test.c test.c (C++) (C++)
#... open ( const char *restrict _name, const char *restrict _type)
FILE *  _EXFUN(fopen, (const char *__restrict _name, const char *__restrict _type));
c:\intelfpga_lite\18.1\nios2eds\bin\gnu\h-x86_64-mingw32\nios2-elf\include\stdio.h
    257  Error 10: Expecting ',' or ')'
_
FILE *  _EXFUN(fopen, (const char *__restrict _name, const char *__restrict _type));
c:\intelfpga_lite\18.1\nios2eds\bin\gnu\h-x86_64-mingw32\nios2-elf\include\stdio.h
    257  Error 49: Expected a type

 

 

 

 

 

0 Kudos
2 Replies
JingyangTeh
Employee
161 Views

Hi


It is weird that you are seeing the error.

Have you managed to compile the project successfully before running the pc-lint?


Regards

Jingyang, Teh


0 Kudos
JingyangTeh
Employee
67 Views

Hi


Since this thread been resolve, I shall set this thread to close pending. If you still need further assistance, you are welcome to reopen this thread within 20days or open a new thread, some one will be right with you. Please login to ‘https://supporttickets.intel.com’, view details of the desire request, and post a feed/response within the next 15 days to allow me to continue to support you. After 15 days, this thread will be transitioned to community support. The community users will be able to help you on your follow-up questions.


If you happened to close this thread you might receive a survey. If you think you would rank your support experience less than 4 out of 10, please allow me to correct it before closing or if the problem can’t be corrected, please let me know the cause so that I may improve your future service experience.


Regards

Jingyang, Teh


0 Kudos
Reply