Enable cppcoreguidelines-pro-type-vararg check
We only had one usage of printf in the code that was in violation of
this rule, so replace it with iostreams, and enable the check.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: Ie62165b599a996f34893aa5a3f8d1f6e6cbaf903
diff --git a/src/ChassisIntrusionSensor.cpp b/src/ChassisIntrusionSensor.cpp
index 4b89709..9b35da2 100644
--- a/src/ChassisIntrusionSensor.cpp
+++ b/src/ChassisIntrusionSensor.cpp
@@ -80,12 +80,15 @@
{
std::string i2cBus = "/dev/i2c-" + std::to_string(busId);
+ // NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg)
int fd = open(i2cBus.c_str(), O_RDWR | O_CLOEXEC);
if (fd < 0)
{
std::cerr << "unable to open i2c device \n";
return -1;
}
+
+ // NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg)
if (ioctl(fd, I2C_SLAVE_FORCE, slaveAddr) < 0)
{
std::cerr << "unable to set device address\n";
@@ -94,6 +97,8 @@
}
unsigned long funcs = 0;
+
+ // NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg)
if (ioctl(fd, I2C_FUNCS, &funcs) < 0)
{
std::cerr << "not support I2C_FUNCS \n";