Pc-Lint setup to lint NIOS2 program
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