fmt-11.1.4-1.fc43

List of Findings

Error: CPPCHECK_WARNING (CWE-562): [#def1]
fmt-11.1.4/include/fmt/base.h:504: error[returnTempReference]: Reference to temporary returned.
#  502|       using OutputIt::container;
#  503|     };
#  504|->   return *accessor(it).container;
#  505|   }
#  506|   }  // namespace detail

Error: CPPCHECK_WARNING (CWE-398): [#def2]
fmt-11.1.4/include/fmt/base.h:1281: error[throwInNoexceptFunction]: Exception thrown in function declared not to throw exceptions.
# 1279|   FMT_CONSTEXPR auto parse_nonnegative_int(const Char*& begin, const Char* end,
# 1280|                                            int error_value) noexcept -> int {
# 1281|->   FMT_ASSERT(begin != end && '0' <= *begin && *begin <= '9', "");
# 1282|     unsigned value = 0, prev = 0;
# 1283|     auto p = begin;

Error: CPPCHECK_WARNING (CWE-398): [#def3]
fmt-11.1.4/include/fmt/format-inl.h:58: error[throwInNoexceptFunction]: Exception thrown in function declared not to throw exceptions.
#   56|       ++error_code_size;
#   57|     }
#   58|->   error_code_size += detail::to_unsigned(detail::count_digits(abs_value));
#   59|     auto it = appender(out);
#   60|     if (message.size() <= inline_buffer_size - error_code_size)

Error: CPPCHECK_WARNING (CWE-398): [#def4]
fmt-11.1.4/include/fmt/format-inl.h:211: error[throwInNoexceptFunction]: Exception thrown in function declared not to throw exceptions.
#  209|   // Various fast log computations.
#  210|   inline auto floor_log10_pow2_minus_log10_4_over_3(int e) noexcept -> int {
#  211|->   FMT_ASSERT(e <= 2936 && e >= -2985, "too large exponent");
#  212|     return (e * 631305 - 261663) >> 21;
#  213|   }

Error: CPPCHECK_WARNING (CWE-398): [#def5]
fmt-11.1.4/include/fmt/format-inl.h:237: error[throwInNoexceptFunction]: Exception thrown in function declared not to throw exceptions.
#  235|     // The idea for item 2 originates from Schubfach.
#  236|     constexpr auto info = div_small_pow10_infos[N - 1];
#  237|->   FMT_ASSERT(n <= info.divisor * 10, "n is too large");
#  238|     constexpr uint32_t magic_number =
#  239|         (1u << info.shift_amount) / info.divisor + 1;

Error: CPPCHECK_WARNING (CWE-398): [#def6]
fmt-11.1.4/include/fmt/format-inl.h:251: error[throwInNoexceptFunction]: Exception thrown in function declared not to throw exceptions.
#  249|   template <int N> auto small_division_by_pow10(uint32_t n) noexcept -> uint32_t {
#  250|     constexpr auto info = div_small_pow10_infos[N - 1];
#  251|->   FMT_ASSERT(n <= info.divisor * 10, "n is too large");
#  252|     constexpr uint32_t magic_number =
#  253|         (1u << info.shift_amount) / info.divisor + 1;

Error: CPPCHECK_WARNING (CWE-398): [#def7]
fmt-11.1.4/include/fmt/format-inl.h:276: error[throwInNoexceptFunction]: Exception thrown in function declared not to throw exceptions.
#  274|   
#  275|     static auto get_cached_power(int k) noexcept -> uint64_t {
#  276|->     FMT_ASSERT(k >= float_info<float>::min_k && k <= float_info<float>::max_k,
#  277|                  "k is out of range");
#  278|       static constexpr const uint64_t pow10_significands[] = {

Error: CPPCHECK_WARNING (CWE-398): [#def8]
fmt-11.1.4/include/fmt/format-inl.h:334: error[throwInNoexceptFunction]: Exception thrown in function declared not to throw exceptions.
#  332|                                    int beta) noexcept
#  333|         -> compute_mul_parity_result {
#  334|->     FMT_ASSERT(beta >= 1, "");
#  335|       FMT_ASSERT(beta < 64, "");
#  336|   

Error: CPPCHECK_WARNING (CWE-398): [#def9]
fmt-11.1.4/include/fmt/format-inl.h:370: error[throwInNoexceptFunction]: Exception thrown in function declared not to throw exceptions.
#  368|   
#  369|     static auto get_cached_power(int k) noexcept -> uint128_fallback {
#  370|->     FMT_ASSERT(k >= float_info<double>::min_k && k <= float_info<double>::max_k,
#  371|                  "k is out of range");
#  372|   

Error: CPPCHECK_WARNING (CWE-398): [#def10]
fmt-11.1.4/include/fmt/format-inl.h:1109: error[throwInNoexceptFunction]: Exception thrown in function declared not to throw exceptions.
# 1107|                                    int beta) noexcept
# 1108|         -> compute_mul_parity_result {
# 1109|->     FMT_ASSERT(beta >= 1, "");
# 1110|       FMT_ASSERT(beta < 64, "");
# 1111|   

Error: CPPCHECK_WARNING (CWE-398): [#def11]
fmt-11.1.4/include/fmt/format-inl.h:1140: error[throwInNoexceptFunction]: Exception thrown in function declared not to throw exceptions.
# 1138|   
# 1139|   FMT_FUNC auto get_cached_power(int k) noexcept -> uint128_fallback {
# 1140|->   return cache_accessor<double>::get_cached_power(k);
# 1141|   }
# 1142|   

Error: CPPCHECK_WARNING (CWE-398): [#def12]
fmt-11.1.4/include/fmt/format-inl.h:1154: error[throwInNoexceptFunction]: Exception thrown in function declared not to throw exceptions.
# 1152|   // Remove trailing zeros from n and return the number of zeros removed (float)
# 1153|   FMT_INLINE int remove_trailing_zeros(uint32_t& n, int s = 0) noexcept {
# 1154|->   FMT_ASSERT(n != 0, "");
# 1155|     // Modular inverse of 5 (mod 2^32): (mod_inv_5 * 5) mod 2^32 = 1.
# 1156|     constexpr uint32_t mod_inv_5 = 0xcccccccd;

Error: CPPCHECK_WARNING (CWE-398): [#def13]
fmt-11.1.4/include/fmt/format-inl.h:1175: error[throwInNoexceptFunction]: Exception thrown in function declared not to throw exceptions.
# 1173|   // Removes trailing zeros and returns the number of zeros removed (double)
# 1174|   FMT_INLINE int remove_trailing_zeros(uint64_t& n) noexcept {
# 1175|->   FMT_ASSERT(n != 0, "");
# 1176|   
# 1177|     // This magic number is ceil(2^90 / 10^8).

Error: CPPCHECK_WARNING (CWE-398): [#def14]
fmt-11.1.4/include/fmt/format-inl.h:1216: error[throwInNoexceptFunction]: Exception thrown in function declared not to throw exceptions.
# 1214|     decimal_fp<T> ret_value;
# 1215|     // Compute k and beta
# 1216|->   const int minus_k = floor_log10_pow2_minus_log10_4_over_3(exponent);
# 1217|     const int beta = exponent + floor_log2_pow10(-minus_k);
# 1218|   

Error: CPPCHECK_WARNING (CWE-398): [#def15]
fmt-11.1.4/include/fmt/format-inl.h:1293: error[throwInNoexceptFunction]: Exception thrown in function declared not to throw exceptions.
# 1291|   
# 1292|     // Compute k and beta.
# 1293|->   const int minus_k = floor_log10_pow2(exponent) - float_info<T>::kappa;
# 1294|     const cache_entry_type cache = cache_accessor<T>::get_cached_power(-minus_k);
# 1295|     const int beta = exponent + floor_log2_pow10(-minus_k);

Error: CPPCHECK_WARNING (CWE-398): [#def16]
fmt-11.1.4/include/fmt/format.h:856: error[throwInNoexceptFunction]: Exception thrown in function declared not to throw exceptions.
#  854|     /// Moves the content of the other `basic_memory_buffer` object to this one.
#  855|     auto operator=(basic_memory_buffer&& other) noexcept -> basic_memory_buffer& {
#  856|->     FMT_ASSERT(this != &other, "");
#  857|       deallocate();
#  858|       move(other);

Error: CPPCHECK_WARNING (CWE-398): [#def17]
fmt-11.1.4/include/fmt/format.h:1378: error[throwInNoexceptFunction]: Exception thrown in function declared not to throw exceptions.
# 1376|   // https://fmt.dev/papers/Dragonbox.pdf#page=28, section 6.1.
# 1377|   inline auto floor_log10_pow2(int e) noexcept -> int {
# 1378|->   FMT_ASSERT(e <= 2620 && e >= -2620, "too large exponent");
# 1379|     static_assert((-1 >> 1) == -1, "right shift is not arithmetic");
# 1380|     return (e * 315653) >> 20;

Error: CPPCHECK_WARNING (CWE-398): [#def18]
fmt-11.1.4/include/fmt/format.h:1384: error[throwInNoexceptFunction]: Exception thrown in function declared not to throw exceptions.
# 1382|   
# 1383|   inline auto floor_log2_pow10(int e) noexcept -> int {
# 1384|->   FMT_ASSERT(e <= 1233 && e >= -1233, "too large exponent");
# 1385|     return (e * 1741647) >> 19;
# 1386|   }

Error: COMPILER_WARNING (CWE-691): [#def19]
fmt-11.1.4/test/format-impl-test.cc: scope_hint: In member function ‘virtual void format_impl_test_write_double_double_Test::TestBody()’
fmt-11.1.4/test/format-impl-test.cc:338:6: warning[-Wdangling-else]: suggest explicit braces to avoid ambiguous ‘else’
#  338 |   if (!FMT_MSC_VERSION) EXPECT_EQ(s, "42");
#      |      ^
#  336|     fmt::detail::write<char>(std::back_inserter(s), double_double(42), {});
#  337|     // Specializing is_floating_point is broken in MSVC.
#  338|->   if (!FMT_MSC_VERSION) EXPECT_EQ(s, "42");
#  339|   }
#  340|   

Error: COMPILER_WARNING (CWE-691): [#def20]
fmt-11.1.4/test/format-impl-test.cc: scope_hint: In member function ‘virtual void format_impl_test_write_dragon_even_Test::TestBody()’
fmt-11.1.4/test/format-impl-test.cc:345:6: warning[-Wdangling-else]: suggest explicit braces to avoid ambiguous ‘else’
#  345 |   if (!FMT_MSC_VERSION) EXPECT_EQ(s, "3.355445e+07");
#      |      ^
#  343|     fmt::detail::write<char>(std::back_inserter(s), slow_float(33554450.0f), {});
#  344|     // Specializing is_floating_point is broken in MSVC.
#  345|->   if (!FMT_MSC_VERSION) EXPECT_EQ(s, "3.355445e+07");
#  346|   }
#  347|   

Error: COMPILER_WARNING (CWE-691): [#def21]
fmt-11.1.4/test/gtest-extra-test.cc: scope_hint: In member function ‘virtual void gtest_extra_test_expect_throw_behaves_like_single_statement_Test::TestBody()’
fmt-11.1.4/test/gtest-extra-test.cc:227:6: warning[-Wdangling-else]: suggest explicit braces to avoid ambiguous ‘else’
#  227 |   if (::testing::internal::AlwaysFalse())
#      |      ^
#  225|   
#  226|   TEST(gtest_extra_test, expect_throw_behaves_like_single_statement) {
#  227|->   if (::testing::internal::AlwaysFalse())
#  228|       EXPECT_THROW_MSG(do_nothing(), std::exception, "");
#  229|   

Error: COMPILER_WARNING (CWE-691): [#def22]
fmt-11.1.4/test/gtest-extra-test.cc: scope_hint: In member function ‘virtual void gtest_extra_test_expect_system_error_behaves_like_single_statement_Test::TestBody()’
fmt-11.1.4/test/gtest-extra-test.cc:237:6: warning[-Wdangling-else]: suggest explicit braces to avoid ambiguous ‘else’
#  237 |   if (::testing::internal::AlwaysFalse())
#      |      ^
#  235|   
#  236|   TEST(gtest_extra_test, expect_system_error_behaves_like_single_statement) {
#  237|->   if (::testing::internal::AlwaysFalse())
#  238|       EXPECT_SYSTEM_ERROR(do_nothing(), EDOM, "");
#  239|   

Error: COMPILER_WARNING (CWE-691): [#def23]
fmt-11.1.4/test/gtest-extra-test.cc: scope_hint: In member function ‘virtual void gtest_extra_test_expect_write_behaves_like_single_statement_Test::TestBody()’
fmt-11.1.4/test/gtest-extra-test.cc:247:6: warning[-Wdangling-else]: suggest explicit braces to avoid ambiguous ‘else’
#  247 |   if (::testing::internal::AlwaysFalse())
#      |      ^
#  245|   
#  246|   TEST(gtest_extra_test, expect_write_behaves_like_single_statement) {
#  247|->   if (::testing::internal::AlwaysFalse())
#  248|       EXPECT_WRITE(stdout, std::printf("x"), "x");
#  249|   

Error: CPPCHECK_WARNING (CWE-562): [#def24]
fmt-11.1.4/test/gtest/gmock/gmock.h:9181: error[returnTempReference]: Reference to temporary returned.
# 9179|     }
# 9180|     TypedExpectation& InSequence(const Sequence& s1, const Sequence& s2) {
# 9181|->     return InSequence(s1).InSequence(s2);
# 9182|     }
# 9183|     TypedExpectation& InSequence(const Sequence& s1, const Sequence& s2,

Error: CPPCHECK_WARNING (CWE-562): [#def25]
fmt-11.1.4/test/gtest/gmock/gmock.h:9185: error[returnTempReference]: Reference to temporary returned.
# 9183|     TypedExpectation& InSequence(const Sequence& s1, const Sequence& s2,
# 9184|                                  const Sequence& s3) {
# 9185|->     return InSequence(s1, s2).InSequence(s3);
# 9186|     }
# 9187|     TypedExpectation& InSequence(const Sequence& s1, const Sequence& s2,

Error: CPPCHECK_WARNING (CWE-562): [#def26]
fmt-11.1.4/test/gtest/gmock/gmock.h:9189: error[returnTempReference]: Reference to temporary returned.
# 9187|     TypedExpectation& InSequence(const Sequence& s1, const Sequence& s2,
# 9188|                                  const Sequence& s3, const Sequence& s4) {
# 9189|->     return InSequence(s1, s2, s3).InSequence(s4);
# 9190|     }
# 9191|     TypedExpectation& InSequence(const Sequence& s1, const Sequence& s2,

Error: CPPCHECK_WARNING (CWE-562): [#def27]
fmt-11.1.4/test/gtest/gmock/gmock.h:9194: error[returnTempReference]: Reference to temporary returned.
# 9192|                                  const Sequence& s3, const Sequence& s4,
# 9193|                                  const Sequence& s5) {
# 9194|->     return InSequence(s1, s2, s3, s4).InSequence(s5);
# 9195|     }
# 9196|   

Error: CPPCHECK_WARNING (CWE-476): [#def28]
fmt-11.1.4/test/gtest/gmock/gmock.h:11324: error[ctunullpointer]: Null pointer dereference: gmock_os
#11322|   // Defines a matcher that matches an empty container. The container must
#11323|   // support both size() and empty(), which all STL-like containers provide.
#11324|-> MATCHER(IsEmpty, negation ? "isn't empty" : "is empty") {
#11325|     if (arg.empty()) {
#11326|       return true;

Error: CPPCHECK_WARNING (CWE-476): [#def29]
fmt-11.1.4/test/gtest/gmock/gmock.h:11336: error[ctunullpointer]: Null pointer dereference: gmock_os
#11334|   // bool" operators and so can't be compared for equality with true
#11335|   // and false.
#11336|-> MATCHER(IsTrue, negation ? "is false" : "is true") {
#11337|     return static_cast<bool>(arg);
#11338|   }

Error: CPPCHECK_WARNING (CWE-476): [#def30]
fmt-11.1.4/test/gtest/gmock/gmock.h:11344: error[ctunullpointer]: Null pointer dereference: gmock_os
#11342|   // bool" operators and so can't be compared for equality with true
#11343|   // and false.
#11344|-> MATCHER(IsFalse, negation ? "is true" : "is false") {
#11345|     return !static_cast<bool>(arg);
#11346|   }

Error: CPPCHECK_WARNING (CWE-562): [#def31]
fmt-11.1.4/test/gtest/gtest/gtest.h:6841: error[returnReference]: Reference to local variable returned.
# 6839|     template <typename T>
# 6840|     static const T& Unwrap(std::reference_wrapper<T> v) {
# 6841|->     return v;
# 6842|     }
# 6843|   

Error: CPPCHECK_WARNING (CWE-664): [#def32]
fmt-11.1.4/test/gtest/gtest/gtest.h:8107: error[mismatchingContainers]: Iterators of different containers 'impl_' and 'other.impl_' are used together.
# 8105|     }
# 8106|     bool operator==(const ParamIterator& other) const {
# 8107|->     return impl_.get() == other.impl_.get() || impl_->Equals(*other.impl_);
# 8108|     }
# 8109|     bool operator!=(const ParamIterator& other) const {

Error: CPPCHECK_WARNING (CWE-562): [#def33]
fmt-11.1.4/test/scan.h:91: error[returnReference]: Reference to local variable returned.
#   89|       }
#   90|   
#   91|->     friend scan_buffer& get_buffer(iterator it) { return *it.buf_; }
#   92|   
#   93|      public:

Error: COMPILER_WARNING (CWE-691): [#def34]
fmt-11.1.4/test/xchar-test.cc: scope_hint: In member function ‘virtual void xchar_test_format_Test::TestBody()’
fmt-11.1.4/test/xchar-test.cc:83:6: warning[-Wdangling-else]: suggest explicit braces to avoid ambiguous ‘else’
#   83 |   if (sizeof(wchar_t) == 4)
#      |      ^
#   81|     EXPECT_EQ(fmt::format(L"{0}", L'a'), L"a");
#   82|     EXPECT_EQ(fmt::format(L"Letter {}", L'\x40e'), L"Letter \x40e");  // Ў
#   83|->   if (sizeof(wchar_t) == 4)
#   84|       EXPECT_EQ(fmt::format(fmt::runtime(L"{:𓀨>3}"), 42), L"𓀨42");
#   85|     EXPECT_EQ(fmt::format(L"{}c{}", L"ab", 1), L"abc1");

Scan Properties

analyzer-version-clippy1.86.0
analyzer-version-cppcheck2.17.1
analyzer-version-gcc15.0.1
analyzer-version-gcc-analyzer15.0.1
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-197.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250425.124705.g1c7c448.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namefmt-11.1.4-1.fc43
store-results-to/tmp/tmp1knx6opu/fmt-11.1.4-1.fc43.tar.xz
time-created2025-04-25 12:45:25
time-finished2025-04-25 12:48:53
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'unicontrol,cppcheck,gcc,clippy,shellcheck' '-o' '/tmp/tmp1knx6opu/fmt-11.1.4-1.fc43.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmp1knx6opu/fmt-11.1.4-1.fc43.src.rpm'
tool-versioncsmock-3.8.1.20250422.172604.g26bc3d6-1.el9