Mark a few clang-tidy findings as false-positive

This commit is contained in:
Tim Wojtulewicz 2020-02-03 17:57:22 -05:00
parent d23b15c08f
commit 3572e38ec2
4 changed files with 9 additions and 1 deletions

View file

@ -918,6 +918,10 @@ const char* CompositeHash::RecoverOneVal(const HashKey* k, const char* kp0,
kp = RecoverOneVal(k, kp, k_end,
rt->FieldType(i), v, optional);
// An earlier call to reporter->InternalError would have called abort() and broken the
// call tree that clang-tidy is relying on to get the error described.
// NOLINTNEXTLINE(clang-analyzer-core.uninitialized.Branch)
if ( ! (v || optional) )
{
reporter->InternalError("didn't recover expected number of fields from HashKey");

View file

@ -436,7 +436,7 @@ unsigned int Specific_RE_Matcher::MemoryAllocation() const
+ equiv_class.Size() - padded_sizeof(EquivClass)
+ (dfa ? dfa->MemoryAllocation() : 0) // this is ref counted; consider the bytes here?
+ padded_sizeof(*any_ccl)
+ padded_sizeof(*accepted)
+ padded_sizeof(*accepted) // NOLINT(bugprone-sizeof-container)
+ accepted->size() * padded_sizeof(AcceptingSet::key_type);
}

View file

@ -1148,6 +1148,8 @@ broker::data& bro_broker::opaque_field_to_data(RecordVal* v, Frame* f)
reporter->RuntimeError(f->GetCall()->GetLocationInfo(),
"Broker::Data's opaque field is not set");
// RuntimeError throws an exception which causes this line to never exceute.
// NOLINTNEXTLINE(clang-analyzer-core.uninitialized.UndefReturn)
return static_cast<DataVal*>(d)->data;
}

View file

@ -90,6 +90,8 @@ Manager::Manager(const string& arg_config, const string& bro_command)
reporter->InternalError("Zeekygen can't get mtime of zeek binary %s (try again by specifying the absolute or relative path to Zeek): %s",
path_to_bro.c_str(), strerror(errno));
// Internal error will abort above in the case that stat isn't initialized
// NOLINTNEXTLINE(clang-analyzer-core.uninitialized.Assign)
bro_mtime = s.st_mtime;
}