Lua can be tightly coupled with C - and by extension, C++ - so swapping back and forth between editing Lua and C-family files is not unusual. This plugin/package adds C-family code checking to Zerobrane Studio, which saves swapping editors/IDEs or finding warnings and errors at the build stage.
It runs whenever you save a C-family source file, running your file through the relevant GCC compiler (gcc
or g++
) as well as performing sophisticated static analysis with CPPCheck,
to catch issues that the compiler doesn't find by itself.
Annotations with prefixes contained in parentheses, eg (error)
, come from CPPCheck. Others come from gcc/g++. Notice that the Null pointer dereference
CPPCheck reported error has an ID added to the end, since it is tracing a single pointer and if multiple similar issues occur, this makes it easy
to differentiate between the traces.
Clone or download and put the .lua
file into the packages
subdirectory of your Zerobrane Studio installation directory.
You must have GCC and CPPCheck available on your command line.
Install MinGW. After installing, run the MinGW Installation Manager
, scroll down the Packages and check mingw32-gcc
and mingw32-gcc-g++
to stage them for installation. Then go to the Installation
menu and Apply changes
.
Go to the CPPCheck website then download and run the installer. Add the location of the installation to your PATH
.
Run:
sudo apt-get update
sudo apt-get install build-essential
sudo apt-get install cppcheck