Skip to content

Commit

Permalink
CI fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
eliaskosunen committed Jan 18, 2024
1 parent 132d608 commit 809e78b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions examples/example_5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ int main()

std::string buf{};
buf.resize(256);
std::fgets(buf.data(), 255, stdin);
std::ignore = std::fgets(buf.data(), 255, stdin);

std::printf("First integer: %d, rest of the line: %s", result->value(),
buf.c_str());
Expand All @@ -39,7 +39,7 @@ int main()

std::string buf{};
buf.resize(256);
std::fgets(buf.data(), 255, stdin);
std::ignore = std::fgets(buf.data(), 255, stdin);

std::printf("Entire line: %s", buf.c_str());
}
3 changes: 3 additions & 0 deletions include/scn/detail/format_string_parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@ class fill_type {
SCN_EXPECT(s.size() * sizeof(CharT) <= max_size);
if constexpr (sizeof(CharT) == 1) {
for (size_t i = 0; i < s.size(); ++i) {
SCN_GCC_PUSH
SCN_GCC_IGNORE("-Wstringop-overflow") // false positive
m_data[i] = s[i];
SCN_GCC_POP
}
m_size = static_cast<unsigned char>(s.size());
}
Expand Down
3 changes: 2 additions & 1 deletion tests/unittests/compilefail_tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ if (NOT SCN_DISABLE_REGEX)
)
endif ()

if (SCN_CXX_FRONTEND STREQUAL "GNU" OR SCN_CXX_FRONTEND STREQUAL "Clang")
if ((SCN_CXX_FRONTEND STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 9.0) OR SCN_CXX_FRONTEND STREQUAL "Clang")
# gcc pre-9 has weird error messages
icm_add_multiple_build_failure_tests(
SOURCES ${buildfail_sources}
PREFIX scn-compilefail
Expand Down

0 comments on commit 809e78b

Please sign in to comment.