-4

I know splint is to issue warning messages about problems in C programs.

I installed it on my Ubuntu using 'sudo apt-get install splint'.

How do I use it on a C program or programs?

Richard Chambers
  • 16,643
  • 4
  • 81
  • 106
Pradeep Ch
  • 103
  • 3
  • 11
  • Perhaps start by reading [the manual](http://www.splint.org/manual/)? Or please specify what in particular you don't understand after reading that. – kaylum Jul 27 '15 at 04:26
  • SPLint is not to fix warning messages(You have to fix the warnings shown by SPLint). It is a static code analyzer which will inform you about probable malfunction of your program.You should read its manual to better understand what it does. – Vagish Jul 27 '15 at 04:26

1 Answers1

2

If you create the following C program in a file called test.c you can then use splint to perform a static analysis on the source to find possible problems.

The source code to put into the file test.c:

#include <stdio.h>

int main(int argc, char *argv[])
{
    int a = 100; 
    int b[8];

    printf("Hello c\n");
    b[8] = 100; // error

    return 0;
}

The command line used to run splint against the C source file to check for problems.

$ splint test.c +bounds -paramuse -varuse
Richard Chambers
  • 16,643
  • 4
  • 81
  • 106
Liyuan Liu
  • 172
  • 2