I am working on an embedded Linux system (kernel-5.10.24) on an SOC platform. Now I am trying to use splint to do code analysis, but I hit parse errors.
I am using GNU toolchains for the SOC (mips), and the command line of splint is as follows,
splint -Iout/buildroot/usr/include/ -I/home/dev/mips-gcc/mips-linux-gnu/libc/usr/include/ -preproc -nestcomment -skipposixheaders -skipisoheaders +
trytorecover +posixlib test_project/src/*.c
And I got following error,
Splint 3.1.2 --- 20 Feb 2018
Command Line: Setting -skipposixheaders redundant with current value
out/buildroot/usr/include/bits/types.h:145:24: Parse Error: Non-function declaration:
__STD_TYPE : int. Attempting to continue.
out/buildroot/usr/include/bits/types.h:149:34: Cannot recover from parse error.
*** Cannot continue.
I checked the types.h
, and got,
141 #include <bits/typesizes.h> /* Defines __*_T_TYPE macros. */
142 #include <bits/time64.h> /* Defines __TIME*_T_TYPE macros. */
143
144
145 __STD_TYPE __DEV_T_TYPE __dev_t; /* Type of device numbers. */
146 __STD_TYPE __UID_T_TYPE __uid_t; /* Type of user identifications. */
147 __STD_TYPE __GID_T_TYPE __gid_t; /* Type of group identifications. */
148 __STD_TYPE __INO_T_TYPE __ino_t; /* Type of file serial numbers. */
149 __STD_TYPE __INO64_T_TYPE __ino64_t; /* Type of file serial numbers (LFS).*/
150 __STD_TYPE __MODE_T_TYPE __mode_t; /* Type of file attribute bitmasks. */
151 __STD_TYPE __NLINK_T_TYPE __nlink_t; /* Type of file link counts. */
152 __STD_TYPE __OFF_T_TYPE __off_t; /* Type of file sizes and offsets. */
I don’t know how to fix this issue, and run splint to check my embedded projects.