Bug 99694

Summary: VSC2015 warning C4334 in gifread.cxx and vbainputstream.cxx
Product: LibreOffice Reporter: Mark_T2016
Component: LibreOfficeAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED MOVED    
Severity: normal CC: ilmari.lauhakangas, raal, serval2412
Priority: medium Keywords: patch
Version: 5.2.0.0.alpha1   
Hardware: x86-64 (AMD64)   
OS: Windows (All)   
Whiteboard:
Crash report or crash signature: Regression By:
Attachments: Modified gifread.cxx
Modified vbainputstream.cxx

Description Mark_T2016 2016-05-05 15:12:48 UTC
Created attachment 124867 [details]
Modified gifread.cxx

Sorry to post as bug rather than submit change via gerrit, I haven't tried to register yet until I get some confidence I can build x64 on Windows with VSC2015.

Warning treated as Error by Visual Studio Community 2015, result of 32-bit shift implicitly converted to 64 bits (was 64-bit shift intended?)

The result of 32-bit shift was implicitly converted to 64-bits, and the compiler suspects that a 64-bit shift was intended. To resolve this warning, either use 64-bit shift, or explicitly cast the shift result to 64-bit.

This prevents compiling x64 from source, but the same can be compiled OK for x86.

Following Microsoft recommendation :-
https://msdn.microsoft.com/en-us/library/ke55d167.aspx

Modified attached copies.

D:\lode\dev\x64\vcl\source\filter\igif\gifread.cxx
at line 251
ReadPaletteEntries( &aGPalette, 1i64 << ( ( nRF & 7 ) + 1 ) );

at line 462
ReadPaletteEntries( pPal, 1i64 << ( (nFlags & 7 ) + 1 ) );

D:\lode\dev\x64\oox\source\ole\vbainputstream.cxx
at line 160
while( static_cast< size_t >( 1i64 << nBitCount ) < maChunk.size() ) ++nBitCount;
Comment 1 Mark_T2016 2016-05-05 15:15:55 UTC
Created attachment 124868 [details]
Modified vbainputstream.cxx

Added modified copy of vbainputstream.cxx, as I seem unable to add two attachments to original bug report.
Comment 2 Mark_T2016 2016-05-05 16:21:56 UTC
Using the following autogen.input

--enable-64-bit
--enable-pch
--disable-ccache
--with-visual-studio=2015
--disable-firebird-sdbc
--disable-cve-tests
Comment 3 Julien Nabet 2016-05-05 17:30:39 UTC
Just for information, you can discuss about patch, building problem here:
http://nabble.documentfoundation.org/Dev-f1639786.html
or on IRC

This link may help for having a general devs' view:
https://wiki.documentfoundation.org/Development
Comment 4 Buovjaga 2016-05-06 14:21:46 UTC
Yep, let's consider this moved to IRC/ML :)