Open In App

Splint — A C program verifier

Last Updated : 22 May, 2018
Improve
Improve
Like Article
Like
Save
Share
Report

C compiler is pretty vague in many aspects of checking program correctness, particularly in type checking. Careful use of prototyping of functions can assist modern C compilers in this task. However, there is still no guarantee that once you have successfully compiled your program that it will run correctly.

The UNIX Lint tool Secure Programming Lint (SPLINT), can assist in checking for a multitude of programming errors. Check out the online manual pages (man splint) for complete details of the splint.

To run splint simply enter the command:

splint myprog.c

Splint is particularly good at checking type checking of variable and function assignments, efficiency, unused variables and function identifiers, unreachable code and possible memory leaks. There are many useful options to help control splint (see man splint).




#include <stdio.h>
int main()
{
    char a[] = "hello";
    printf("%d\n", a);
    return 0;
}


Output :


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads