mcmilk / 7-Zip-zstd

7-Zip with support for Brotli, Fast-LZMA2, Lizard, LZ4, LZ5 and Zstandard
https://mcmilk.de/projects/7-Zip-zstd/
Other
4.87k stars 293 forks source link

fix -Werror build (22.01) #297

Closed sebres closed 1 year ago

sebres commented 1 year ago

This PR resolves:

It'd silence two warnings, thus fixes errors in build with -Werror. For instance build of 7za with gcc:

ZstdDecoder.cpp, [-Werror=deprecated-declarations] ``` ../../Compress/ZstdDecoder.cpp: In member function 'HRESULT NCompress::NZSTD::CDecoder::CodeSpec(ISequentialInStream*, ISequentialOutStream*, ICompressProgressInfo*)': ../../Compress/ZstdDecoder.cpp:84:22: error: 'size_t ZSTD_resetDStream(ZSTD_DStream*)' is deprecated: use ZSTD_DCtx_reset, see zstd.h for detailed instructions [-Werror=deprecated-declarations] 84 | ZSTD_resetDStream(_ctx); | ~~~~~~~~~~~~~~~~~^~~~~~ In file included from ../../Compress/ZstdDecoder.h:5, from ../../Compress/ZstdDecoder.cpp:4: C:/Projects/7-Zip-Ex/C/zstd/zstd.h:2603:27: note: declared here 2603 | ZSTDLIB_STATIC_API size_t ZSTD_resetDStream(ZSTD_DStream* zds); | ^~~~~~~~~~~~~~~~~ ../../Compress/ZstdDecoder.cpp:139:35: error: 'size_t ZSTD_resetDStream(ZSTD_DStream*)' is deprecated: use ZSTD_DCtx_reset, see zstd.h for detailed instructions [-Werror=deprecated-declarations] 139 | result = ZSTD_resetDStream(_ctx); | ~~~~~~~~~~~~~~~~~^~~~~~ C:/Projects/7-Zip-Ex/C/zstd/zstd.h:2603:27: note: declared here 2603 | ZSTDLIB_STATIC_API size_t ZSTD_resetDStream(ZSTD_DStream* zds); | ^~~~~~~~~~~~~~~~~ cc1plus.exe: all warnings being treated as errors ```
UpdateCallback.cpp, [-Werror=reorder] ``` In file included from ../../UI/Common/UpdateCallback.cpp:36: ../../UI/Common/UpdateCallback.h: In constructor 'CArchiveUpdateCallback::CArchiveUpdateCallback()': ../../UI/Common/UpdateCallback.h:178:9: error: 'CArchiveUpdateCallback::ProcessedItemsStatuses' will be initialized after [-Werror=reorder] 178 | Byte *ProcessedItemsStatuses; | ^~~~~~~~~~~~~~~~~~~~~~ ../../UI/Common/UpdateCallback.h:140:8: error: 'bool CArchiveUpdateCallback::VolNumberAfterExt' [-Werror=reorder] 140 | bool VolNumberAfterExt; | ^~~~~~~~~~~~~~~~~ ../../UI/Common/UpdateCallback.cpp:58:1: error: when initialized here [-Werror=reorder] 58 | CArchiveUpdateCallback::CArchiveUpdateCallback(): | ^~~~~~~~~~~~~~~~~~~~~~ cc1plus.exe: all warnings being treated as errors ```
mcmilk commented 1 year ago

Thank you.