backport-21.03-fix-for-GCC-10.patch 759 B

12345678910111213141516171819
  1. diff --git a/CPP/7zip/Common/OffsetStream.cpp b/CPP/7zip/Common/OffsetStream.cpp
  2. index b3e710f..b16124c 100644
  3. --- a/CPP/7zip/Common/OffsetStream.cpp
  4. +++ b/CPP/7zip/Common/OffsetStream.cpp
  5. @@ -20,13 +20,13 @@ STDMETHODIMP COffsetOutStream::Write(const void *data, UInt32 size, UInt32 *proc
  6. STDMETHODIMP COffsetOutStream::Seek(Int64 offset, UInt32 seekOrigin, UInt64 *newPosition)
  7. {
  8. - UInt64 absoluteNewPosition;
  9. if (seekOrigin == STREAM_SEEK_SET)
  10. {
  11. if (offset < 0)
  12. return HRESULT_WIN32_ERROR_NEGATIVE_SEEK;
  13. offset += _offset;
  14. }
  15. + UInt64 absoluteNewPosition = 0; // =0 for gcc-10
  16. HRESULT result = _stream->Seek(offset, seekOrigin, &absoluteNewPosition);
  17. if (newPosition)
  18. *newPosition = absoluteNewPosition - _offset;