Installing Splint on MacOS
During my current adventure shoring up my C programming skills I came across Splint (short for Secure Programming Lint), a really helpful guide on the path to writing good C code - though it's no miracle worker!
Unfortunately, it doesn't come pre-installed with any version of macOS, at least it doesn't with any version up to macOS Sierra (can't speak for macOS High Sierra though I'd be very surprised if it did!).
Thankfully it's pretty easy to install, though the official Splint documentation would probably have you thinking otherwise.
You can compile Splint from source, but by far the easiest installation is via Homebrew, a pretty capable package manager for macOS. If you don't already have Homebrew installed it's as simple as running the following command in Terminal:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Once Homebrew is done installing, ensure your formulae are up-to-date:
brew update
Then simply install Splint with:
brew install splint
That's it, all done! Splint is now accessible within terminal using the splint
command, pointing it towards some source code to critique.
Photo by Amador Loureiro