home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / unix / vim-6.2.tar.bz2 / vim-6.2.tar / vim62 / runtime / compiler / splint.vim < prev    next >
Encoding:
Text File  |  2003-05-11  |  2.1 KB  |  67 lines

  1. " Vim compiler file
  2. " Compiler:     splint/lclint (C source code checker)
  3. " Maintainer:   Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
  4. " Splint Home:    http://www.splint.org/
  5. " Last Change:  $Date: 2002/06/12 09:17:11 $
  6. " $Revision: 1.7 $
  7.  
  8. if exists("current_compiler")
  9.   finish
  10. endif
  11. let current_compiler = "splint"
  12.  
  13. let s:cpo_save = &cpo
  14. set cpo-=C
  15.  
  16. " adapt this if you want to check more than one file at a time.
  17. " put command line options in .splintrc or ~/.splintrc
  18. setlocal makeprg=splint\ %
  19.  
  20. " Note: when using the new array bounds checking flags:  Each warning
  21. " usually has several lines and several references to source code mostly
  22. " within one or two lines (see sample warning below).  The easiest way
  23. " not to mess up file name detection and not to jump to all positions is
  24. " to add something like
  25. "    -linelen 500 +boundscompacterrormessages
  26. " to your .splintrc and 'set cmdheight=4' or more.
  27. " TODO: reliable way to distinguish file names and constraints.
  28. "
  29. " sample warning (generic):
  30. "
  31. "foo.c:1006:12: Clauses exit with var referencing local storage in one
  32. "               case, fresh storage in other case
  33. "   foo.c:1003:2: Fresh storage var allocated
  34. "
  35. " sample warning (bounds checking):
  36. "
  37. "bounds.c: (in function updateEnv)
  38. "bounds.c:10:5: Possible out-of-bounds store:
  39. "    strcpy(str, tmp)
  40. "    Unable to resolve constraint:
  41. "    requires maxSet(str @ bounds.c:10:13) >= maxRead(getenv("MYENV") @
  42. "    bounds.c:6:9)
  43. "     needed to satisfy precondition:
  44. "    requires maxSet(str @ bounds.c:10:13) >= maxRead(tmp @ bounds.c:10:18)
  45. "     derived from strcpy precondition: requires maxSet(<parameter 1>) >=
  46. "    maxRead(<parameter 2>)
  47. "  A memory write may write to an address beyond the allocated buffer. (Use
  48. "  -boundswrite to inhibit warning)
  49.  
  50. setlocal errorformat=%OLCLint*m,
  51.     \%OSplint*m,
  52.     \%*[\ ]%f:%l:%c:\ %m,
  53.     \%*[\ ]%f:%l:\ %m,
  54.     \%*[^\"]\"%f\"%*\\D%l:\ %m,
  55.     \\"%f\"%*\\D%l:\ %m,
  56.     \%A%f:%l:%c:\ %m,
  57.     \%A%f:%l:%m,
  58.     \\"%f\"\\,
  59.     \\ line\ %l%*\\D%c%*[^\ ]\ %m,
  60.     \%D%*\\a[%*\\d]:\ Entering\ directory\ `%f',
  61.     \%X%*\\a[%*\\d]:\ Leaving\ directory\ `%f',
  62.     \%DMaking\ %*\\a\ in\ %f,
  63.     \%C\ \ %m
  64.  
  65. let &cpo = s:cpo_save
  66. unlet s:cpo_save
  67.