BubblesInTheTub / torrent7z

A fork of torrent7z, viz a derivative of 7zip that produces invariant .7z archives for torrenting
GNU General Public License v3.0
48 stars 5 forks source link

Fix -Wnarrowing on GCC 10 #9

Closed paulyc closed 3 years ago

paulyc commented 3 years ago

Build errors out on GCC 10 with ../../../Common/MyWindows.h:91:41: error: narrowing conversion of ‘-2147467263’ from ‘LONG’ {aka ‘int’} to ‘unsigned int’ [-Wnarrowing], etc, so cast the switch expression to HRESULT. Ok, fair enough for a warning, but what I dont understand is why I'm getting an error rather than a warning cause I don't see -Werror anywhere here??? In any case I don't think casting the switch expression can cause any harm :P (but you never know with C++, there could be an overloaded operator(HRESULT) lurking somewhere ;)

g++ -O -s -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -DNDEBUG -D_REENTRANT -DENV_UNIX -DCOMPRESS_MT -DCOMPRESS_BZIP2_MT -DCOMPRESS_MF_MT -DBREAK_HANDLER -DBENCH_MT -D_NO_CRYPTO -DWIN_LONG_PATH -DUNICODE -fPIE -D_UNICODE -DBUILD_SHARED_LIB=OFF -c -I../../../myWindows -I../../../ -I../../../include_windows ../../../Windows/Error.cpp

BubblesInTheTub commented 3 years ago

Thanks for the fix, I've merged it in.