Skip to content

Commit

Permalink
address GCC false positive warning
Browse files Browse the repository at this point in the history
  • Loading branch information
arvidn committed Oct 1, 2024
1 parent 89b70c5 commit a9ce1c9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,4 +214,4 @@ jobs:
set PATH=%BOOST_ROOT%;%PATH%
set PYTHON_INTERPRETER=python
cd test
b2 toolset=gcc asserts=on release target-os=windows -l400 warnings=all warnings-as-errors=on ${{ matrix.config }} cxxflags=-Wno-error=array-bounds cxxflags=-Wno-error=stringop-overflow deterministic-tests testing.execute=off
b2 toolset=gcc asserts=on release target-os=windows -l400 warnings=all warnings-as-errors=on ${{ matrix.config }} cxxflags=-Wno-error=array-bounds deterministic-tests testing.execute=off
7 changes: 7 additions & 0 deletions src/torrent_peer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,15 @@ namespace libtorrent {
offset = std::max(i + 1, size_t(5));
else if (i > offset)
{
#if defined __GNUC__ && __GNUC__ >= 7
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstringop-overflow"
#endif
b1[i] &= 0x55;
b2[i] &= 0x55;
#if defined __GNUC__ && __GNUC__ >= 7
#pragma GCC diagnostic pop
#endif
}
}
std::uint64_t addrbuf[4];
Expand Down

0 comments on commit a9ce1c9

Please sign in to comment.