cppcheckR {cppcheckR} | R Documentation |
Check a C/C++ file or a folder
Description
HTML widget which runs Cppcheck.
Usage
cppcheckR(
path,
std = NULL,
def = NULL,
undef = NULL,
checkConfig = FALSE,
height = NULL,
elementId = NULL
)
Arguments
path |
path to a C/C++ file or to a folder containing C/C++ files |
std |
the standard, one of |
def |
character vector of symbols you want to define, e.g.
|
undef |
character vector of symbols you want to undefine;
if |
checkConfig |
Boolean, whether to run Cppcheck with the
option |
height |
height in pixels (defaults to automatic sizing) |
elementId |
an id for the widget, this is usually useless |
Value
A htmlwidget
object.
Examples
example <- function(file){
filepath <- system.file("cppexamples", file, package = "cppcheckR")
lines <- readLines(filepath)
print(cppcheckR(filepath, std = "c++03", def = NA, undef = NA))
message(file, ":")
cat(paste0(format(seq_along(lines)), ". ", lines), sep = "\n")
}
example("memleak.cpp")
example("outofbounds.cpp")
example("unusedvar.cpp")
example("useless.cpp")