splint ("secure programming lint") is a lint implementation, i.e. a tool for statically checking C programs for security vulnerabilities and coding mistakes. With minimal effort, Splint can be used as a better lint. If additional effort is invested adding annotations to programs, Splint can perform stronger checking than can be done by any standard lint.
Questions tagged [splint]
84 questions
1
vote
0 answers
How to resolve parse error in Splint
Splint is not continuing it's checking after finding parse errors. I've tried with +trytorecover option also but no change.
Please let me know on how to use +trytorecover to make Splint attempt to continue after a parse error.
Here is what I'm…

Thi
- 2,297
- 7
- 26
- 36
1
vote
0 answers
Splint warns undefined storage. Sanity check please?
I'm working on a game at the moment, and I'm having an issue with splint on the following code to add new enemy structs to my linked list.
void generate_enemy(enemy_struct* enemy)
{
enemy_struct* new_enemy;
// Make sure the incoming enemy…

Minifig666
- 111
- 1
- 5
1
vote
3 answers
splint failing on code that includes complex.h
I'm trying to run splint on a C source that includes complex.h from the standard C library to support complex arithmetic.
Unfortunately, splint fails with the following error.
Splint 3.1.2 --- 03 May 2009
/usr/include/bits/cmathcalls.h:54:31:
…

Shawn Chin
- 84,080
- 19
- 162
- 191
1
vote
1 answer
How to connect Gradle to custom EXE and hook its console output?
Although this question involves the C language, the Gradle C Plugin, and an oldschool C static analyzer called splint, I believe this question can be answered by any Gradle guru who understands how to wire a Gradle build up to an executable…

smeeb
- 27,777
- 57
- 250
- 447
1
vote
1 answer
Transfer ownership of storage in Splint
Using a simple linked list implementation in C, how do I tell Splint that I am transfer ownership of data?
typedef struct {
void* data;
/*@null@*/ void* next;
} list;
static /*@null@*/ list* new_list(/*@notnull@*/ void* data)
{
list*…

Olle Härstedt
- 3,799
- 1
- 24
- 57
1
vote
1 answer
Splint: substitute non-standard type `bit` with `unsigned char`
(This is an extension to my previous question). I'm using Splint in Windows CLI.
The XC8 embedded C compiler has a custom type bit. To get Splint to parse, I can pass to it the CLI option:
-Dbit=char
However I need it to replace bit with unsigned…

Jodes
- 14,118
- 26
- 97
- 156
1
vote
2 answers
Non-standard function return types: Fixing Splint parse error
I'm using the embedded-system XC8 C compiler (for PIC microprocessors). The following is allowed:
bit foo(){
//...
}
but being non-standard C, the Splint static analyser gives the following error:
Parse Error: Non-function declaration: bit :
…

Jodes
- 14,118
- 26
- 97
- 156
1
vote
1 answer
Splint: new fresh storage from strcpy()?
I'm trying to learn and better understand splint, and I'm wondering about an error that I get from this code:
#include
#include
#include
/*@null@*/ /*@only@*/ char *dupStr(const char *str) {
char *copy;
…

potrzebie
- 1,768
- 1
- 12
- 25
1
vote
0 answers
filter_var and SplInt Quirkieness
I'm assuming that this is just due to the relatively new state of the SPL_Types extension. You would think this would have a predictable response.
$integer = new \SplInt( 5 );
if( false === filter_var( $integer, FILTER_VALIDATE_INT, array(…

CVEEP
- 441
- 4
- 12
1
vote
0 answers
Splint static code analysis segmentation fault
Hey I'm trying to do some static analysis on a c cqde project I've written, but splint is giving me an error
$ splint -preproc ASL_ACAN.c
Splint 3.1.1 --- 28 Apr 2003
*** Segmentation Violation
*** Location (not trusted): Command Line
*** Last code…

Reuben Posthuma
- 159
- 8
1
vote
0 answers
Immediate address transfer inconsistently SPLINT
I have a code segment here, but SPLINT is giving me a warning here
"tcpuip\dhcpc\dhcpc.c: (in function send_discover)
tcpuip\dhcpc\dhcpc.c(219,21): Immediate address &m->options[4] passed as only
param: add_msg_type…

Ishmeet
- 1,540
- 4
- 17
- 34
0
votes
1 answer
/usr/include/arpa/inet.h:35:27: Parse Error in Splint
While checking my code with splint, I got one problem. At first i got an error on POSIXLIB. So I run splint with +posixlib as follows,
splint mss_client_main.c +posixlib -I ../include/
But i got the following error :
Splint 3.1.1 --- 15 Jun…

Dinesh
- 16,014
- 23
- 80
- 122
0
votes
1 answer
Why doesn't splint parse curl/curlbuild.h?
I wrote a fornol.c program that uses the curl library, and therefore includes the following:
#include
I want to run splint on my program, but this is the error I get:
$ splint fornol.c
Splint 3.1.2 --- 03 May…

lindelof
- 34,556
- 31
- 99
- 140
0
votes
4 answers
How does splint know my function isn't used in another file?
Splint gives me the following warning:
encrypt.c:4:8: Function exported but not used outside encrypt: flip
A declaration is exported, but not used outside this module. Declaration can
use static qualifier. (Use -exportlocal to inhibit warning)
…

ojblass
- 21,146
- 22
- 83
- 132
0
votes
0 answers
`splint` and dynamically allocated arrays: Returned storage not completely defined
I am working on a little project and want to make it splint-proof for kicks. I am allocating an array and passing it on to a function that generates values and assigns them to array elements, i.e.
#include
#include
static void…

Andrii Kozytskyi
- 123
- 2
- 11