C2220: warning treated as error (64 bit MSVC 2015)

Luke Benes lukebenes at hotmail.com
Thu May 19 22:06:53 UTC 2016


With the LODE environment, I can build the 32-bit binary without any errors. Recently, the 64-bit builds stopped working. For 64-bit I get the following error:
[build CXX] vcl/source/filter/jpeg/Exif.cxx/core/vcl/source/filter/igif/gifread.cxx(251): error C2220: warning treated as error - no 'object' file generated/core/vcl/source/filter/igif/gifread.cxx(251): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)/core/vcl/source/filter/igif/gifread.cxx(462): warning C4334: '<<': result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)[build CXX] vcl/source/filter/jpeg/jpeg.cxx/core/solenv/gbuild/LinkTarget.mk:189: recipe for target '/core/workdir/CxxObject/vcl/source/filter/igif/gifread.o' failedmake[1]: *** [/core/workdir/CxxObject/vcl/source/filter/igif/gifread.o] Error 2make[1]: *** Waiting for unfinished jobs....Makefile:257: recipe for target 'build' failedmake: *** [build] Error 2
I tried to bisect it, and couldn't build anything as far back as I tried. Could this be from an update to my OS (Win 10) or MSVC?
The following incorrect/bad hack allowed me to build it:
diff --git a/oox/source/ole/vbainputstream.cxx b/oox/source/ole/vbainputstream.cxxindex 65eb91c..db87aca 100644--- a/oox/source/ole/vbainputstream.cxx+++ b/oox/source/ole/vbainputstream.cxx@@ -157,7 +157,7 @@ bool VbaInputStream::updateChunk()                     sal_uInt16 nCopyToken = mpInStrm->readuInt16();                     nChunkPos = nChunkPos + 2;                     // update bit count used for offset/length in the token-                    while( static_cast< size_t >( 1 << nBitCount ) < maChunk.size() ) ++nBitCount;+                    while( static_cast< size_t >( 1i64 << nBitCount ) < maChunk.size() ) ++nBitCount;                     // extract length from lower (16-nBitCount) bits, plus 3                     sal_uInt16 nLength = extractValue< sal_uInt16 >( nCopyToken, 0, 16 - nBitCount ) + 3;                     // extract offset from high nBitCount bits, plus 1diff --git a/vcl/source/filter/igif/gifread.cxx b/vcl/source/filter/igif/gifread.cxxindex 01060ab..ba3a2fc 100644--- a/vcl/source/filter/igif/gifread.cxx+++ b/vcl/source/filter/igif/gifread.cxx@@ -248,7 +248,7 @@ bool GIFReader::ReadGlobalHeader()                 bGlobalPalette = ( nRF & 0x80 );                  if( bGlobalPalette )-                    ReadPaletteEntries( &aGPalette, 1 << ( ( nRF & 7 ) + 1 ) );+                    ReadPaletteEntries( &aGPalette, 1i64 << ( ( nRF & 7 ) + 1 ) );                 else                     nBackgroundColor = 0; @@ -459,7 +459,7 @@ bool GIFReader::ReadLocalHeader()         if( nFlags & 0x80 )         {             pPal = &aLPalette;-            ReadPaletteEntries( pPal, 1 << ( (nFlags & 7 ) + 1 ) );+            ReadPaletteEntries( pPal, 1i64 << ( (nFlags & 7 ) + 1 ) );         }         else             pPal = &aGPalette;
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice/attachments/20160519/a49b7893/attachment.html>


More information about the LibreOffice mailing list