The following issues were found
src/third_party/abseil-cpp-master/abseil-cpp/absl/base/inline_variable_test.cc
1 issues
Line: 34
static_assert(other_inline_variable_int == 5, "");
}
TEST(InlineVariableTest, DefaultConstructedIdentityEquality) {
EXPECT_EQ(get_foo_a().value, 5);
EXPECT_EQ(get_foo_b().value, 5);
EXPECT_EQ(&get_foo_a(), &get_foo_b());
}
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/base/internal/atomic_hook_test.cc
1 issues
Line: 29
int value = 0;
void TestHook(int x) { value = x; }
TEST(AtomicHookTest, NoDefaultFunction) {
ABSL_INTERNAL_ATOMIC_HOOK_ATTRIBUTES static absl::base_internal::AtomicHook<
void (*)(int)>
hook;
value = 0;
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/base/internal/dynamic_annotations.h
1 issues
Line: 375
Column: 5
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
__sanitizer_annotate_contiguous_container(beg, end, old_mid, new_mid)
#define ADDRESS_SANITIZER_REDZONE(name) \
struct { \
char x[8] __attribute__((aligned(8))); \
} name
#else
#define ANNOTATE_CONTIGUOUS_CONTAINER(beg, end, old_mid, new_mid)
Reported by FlawFinder.
src/third_party/abseil-cpp-master/abseil-cpp/absl/base/internal/errno_saver_test.cc
1 issues
Line: 34
}
bool operator==(ErrnoPrinter one, ErrnoPrinter two) { return one.no == two.no; }
TEST(ErrnoSaverTest, Works) {
errno = EDOM;
{
absl::base_internal::ErrnoSaver errno_saver;
EXPECT_THAT(ErrnoPrinter{errno}, Eq(ErrnoPrinter{EDOM}));
errno = ERANGE;
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/base/internal/fast_type_id_test.cc
1 issues
Line: 76
A(int64_t) \
A(uint64_t)
TEST(FastTypeIdTest, FixedWidthTypes) {
bi::FastTypeIdType type_ids[] = {
#define A(T) bi::FastTypeId<T>(),
FIXED_WIDTH_TYPES(A)
#undef A
#define A(T) bi::FastTypeId<const T>(),
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/base/internal/low_level_alloc_test.cc
1 issues
Line: 170
// This is JS here. Don't try to format it.
MAIN_THREAD_EM_ASM({
if (ENVIRONMENT_IS_WEB) {
if (typeof TEST_FINISH === 'function') {
TEST_FINISH($0);
} else {
console.error('Attempted to exit with status ' + $0);
console.error('But TEST_FINSIHED is not a function.');
}
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/base/internal/periodic_sampler_test.cc
1 issues
Line: 41
MOCK_METHOD(int64_t, GetExponentialBiased, (int), (noexcept));
};
TEST(PeriodicSamplerBaseTest, Sample) {
StrictMock<MockPeriodicSampler> sampler;
EXPECT_CALL(sampler, period()).Times(3).WillRepeatedly(Return(16));
EXPECT_CALL(sampler, GetExponentialBiased(16))
.WillOnce(Return(2))
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/base/internal/strerror.cc
1 issues
Line: 54
Column: 3
CWE codes:
119
120
Suggestion:
Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length
}
std::string StrErrorInternal(int errnum) {
char buf[100];
const char* str = StrErrorAdaptor(errnum, buf, sizeof buf);
if (*str == '\0') {
snprintf(buf, sizeof buf, "Unknown error %d", errnum);
str = buf;
}
Reported by FlawFinder.
src/third_party/abseil-cpp-master/abseil-cpp/absl/base/internal/strerror_test.cc
1 issues
Line: 33
using ::testing::AnyOf;
using ::testing::Eq;
TEST(StrErrorTest, ValidErrorCode) {
errno = ERANGE;
EXPECT_THAT(absl::base_internal::StrError(EDOM), Eq(strerror(EDOM)));
EXPECT_THAT(errno, Eq(ERANGE));
}
Reported by Cppcheck.
src/third_party/abseil-cpp-master/abseil-cpp/absl/base/internal/sysinfo_test.cc
1 issues
Line: 47
// frequency, while others do not. Since we can't predict a priori what a given
// machine is going to do, just disable this test on POWER on Linux.
#if !(defined(__linux) && (defined(__ppc64__) || defined(__PPC64__)))
TEST(SysinfoTest, NominalCPUFrequency) {
// Linux only exposes the CPU frequency on certain architectures, and
// Emscripten doesn't expose it at all.
#if defined(__linux__) && \
(defined(__aarch64__) || defined(__hppa__) || defined(__mips__) || \
defined(__riscv) || defined(__s390x__)) || \
Reported by Cppcheck.