mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 16:18:19 +00:00
Mark a few clang-tidy findings as false-positive
This commit is contained in:
parent
d23b15c08f
commit
3572e38ec2
4 changed files with 9 additions and 1 deletions
|
@ -918,6 +918,10 @@ const char* CompositeHash::RecoverOneVal(const HashKey* k, const char* kp0,
|
||||||
|
|
||||||
kp = RecoverOneVal(k, kp, k_end,
|
kp = RecoverOneVal(k, kp, k_end,
|
||||||
rt->FieldType(i), v, optional);
|
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) )
|
if ( ! (v || optional) )
|
||||||
{
|
{
|
||||||
reporter->InternalError("didn't recover expected number of fields from HashKey");
|
reporter->InternalError("didn't recover expected number of fields from HashKey");
|
||||||
|
|
|
@ -436,7 +436,7 @@ unsigned int Specific_RE_Matcher::MemoryAllocation() const
|
||||||
+ equiv_class.Size() - padded_sizeof(EquivClass)
|
+ equiv_class.Size() - padded_sizeof(EquivClass)
|
||||||
+ (dfa ? dfa->MemoryAllocation() : 0) // this is ref counted; consider the bytes here?
|
+ (dfa ? dfa->MemoryAllocation() : 0) // this is ref counted; consider the bytes here?
|
||||||
+ padded_sizeof(*any_ccl)
|
+ padded_sizeof(*any_ccl)
|
||||||
+ padded_sizeof(*accepted)
|
+ padded_sizeof(*accepted) // NOLINT(bugprone-sizeof-container)
|
||||||
+ accepted->size() * padded_sizeof(AcceptingSet::key_type);
|
+ accepted->size() * padded_sizeof(AcceptingSet::key_type);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1148,6 +1148,8 @@ broker::data& bro_broker::opaque_field_to_data(RecordVal* v, Frame* f)
|
||||||
reporter->RuntimeError(f->GetCall()->GetLocationInfo(),
|
reporter->RuntimeError(f->GetCall()->GetLocationInfo(),
|
||||||
"Broker::Data's opaque field is not set");
|
"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;
|
return static_cast<DataVal*>(d)->data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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",
|
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));
|
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;
|
bro_mtime = s.st_mtime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue