News for hackers. Stuff that matters.
Re:Was the iOS SSL Flaw Deliberate? by mzs on Thursday February 27, 2014 @04:12PM (#7315098)
There is a list here:

http://en.wikipedia.org/wiki/List_of_tools_for_static_code_a...

Also there is oclint not listed there, which is pretty amazing, but it has a strange notation for ignoring wqrnings. splint is pretty good too though and still supports the legacy lint stuff like /* NOTREACHED /

BSD lint seems to work still (though it looks like the lintlib is no longer built on FreeBSD and stdlib is not lint clean!) but even it would have caught this gotofail:

  01: #include <stdlib.h>
  02: 
  03: int
  04: main(int argc, char *argv[])
  05: {
  06:   if (argc == 0)
  07:           goto fail;
  08:           goto fail;
  09: 
  10:   exit(0);
  11: 
  12: 
  13: fail:
  14:   exit(1);
  15: }
  $ lint a.c 
  a.c:
  stdlib.h(286): warning: ANSI C does not support 'long  long' [265]
  stdlib.h(287): warning: ANSI C does not support 'long long' [265]
  stdlib.h(287): warning: ANSI C does not support 'long long' [265]
  a.c(10): warning: statement not reached [193]
  a.c(15): warning: function main falls off bottom without returning value [217]
  a.c(4): warning: argument argv unused in function main [231]
  _types.h(61): warning: struct __timer never defined [233]
  _types.h(62): warning: struct __mq never defined [233]
  lint: cannot find llib-lc.ln
  Lint pass2:
  exit used( a.c(10) ), but not defined
  $ cc a.c 
  $ ./a.out 
  $ echo $?
  1
edit: grrr, sorry small copy/paste mistakes before.

There are no comments on this comment yet.