Celebrating the 22th anniversary of the UltraVNC: https://forum.uvnc.com/viewtopic.php?t=38031
Update: UltraVNC 1.4.3.6 and UltraVNC SC 1.4.3.6: https://forum.uvnc.com/viewtopic.php?t=37885
Important: Please update to latest version before to create a reply, a topic or an issue: https://forum.uvnc.com/viewtopic.php?t=37864

Join us on social networks and share our announcements:
- Website: https://uvnc.com/
- GitHub: https://github.com/ultravnc
- Mastodon: https://mastodon.social/@ultravnc
- Bluesky/AT Protocol: https://bsky.app/profile/ultravnc.bsky.social
- Facebook: https://www.facebook.com/ultravnc1
- X/Twitter: https://x.com/ultravnc1
- Reddit community: https://www.reddit.com/r/ultravnc
- OpenHub: https://openhub.net/p/ultravnc

Lots of compiler warnings // resulting filesize

Post Reply
netwolf
40
40
Posts: 112
Joined: 2004-05-13 11:33

Lots of compiler warnings // resulting filesize

Post by netwolf »

I just downloaded sources from CVS and tried my first compilation.
Well, I had to comment '#include <iostream.h> to make it compile with VS.net 2003, I assume that's normal.

However, when compiling a release version I get lots and lots of compiler warnings, mostly regarding signed/unsigned mismatch and "dangerous" conversions/casts.

I know that warning != error, so if this is not specific to VS.net2k3, I'd suggest you rather fix those warnings, as it's always better to treat warnings like errors and not "ignore them as long as the sources compile" ;)

The other question is: is it normal that the size of a self-compiled winvnc.exe is only ~688kb, while winvnc.exe of RC20 is about 830kb?
Can compiler optimizations make such a difference ?

Compiler warnings I get when compiling a winvnc.exe release version:

Code: Select all

d:\UltraVNC\ultravnc\winvnc\winvnc\black_layered.cpp(15): warning C4005: 'WS_EX_LAYERED' : macro redefinition
Xregion Command line warning D4002 : ignoring unknown option '/QaxWK'
Xregion Command line warning D4002 : ignoring unknown option '/O3'
libjpeg Command line warning D4002 : ignoring unknown option '/O3'
libjpeg Command line warning D4002 : ignoring unknown option '/QaxM'
libjpeg Command line warning D4002 : ignoring unknown option '/Qip'
d:\UltraVNC\ultravnc\winvnc\omnithread\nt.cpp(484): warning C4297: 'omni_thread_wrapper' : function assumed not to throw an exception but does
rdr Command line warning D4002 : ignoring unknown option '/O3'
rdr Command line warning D4002 : ignoring unknown option '/QaxM'
rdr Command line warning D4002 : ignoring unknown option '/Qip'
logmessages warning LNK4068: /MACHINE not specified; defaulting to X86
vnchooks Command line warning D4002 : ignoring unknown option '/O3'
vnchooks Command line warning D4002 : ignoring unknown option '/QaxM'
vnchooks Command line warning D4002 : ignoring unknown option '/Qip'
winvnc Command line warning D4002 : ignoring unknown option '/O3'
winvnc Command line warning D4002 : ignoring unknown option '/QaxWK'
d:\UltraVNC\ultravnc\winvnc\winvnc\winvnc.cpp(108): warning C4018: '<' : signed/unsigned mismatch
d:\UltraVNC\ultravnc\winvnc\winvnc\winvnc.cpp(114): warning C4018: '<' : signed/unsigned mismatch
d:\UltraVNC\ultravnc\winvnc\winvnc\vncserver.cpp(1397): warning C4244: '=' : conversion from 'WORD' to 'CARD8', possible loss of data
d:\UltraVNC\ultravnc\winvnc\winvnc\vncserver.cpp(1465): warning C4018: '<' : signed/unsigned mismatch
d:\UltraVNC\ultravnc\winvnc\winvnc\vnchttpconnect.cpp(357): warning C4018: '<' : signed/unsigned mismatch
d:\UltraVNC\ultravnc\winvnc\winvnc\vncEncodeUltra.cpp(270): warning C4018: '>' : signed/unsigned mismatch
d:\UltraVNC\ultravnc\winvnc\winvnc\vncEncodeUltra.cpp(312): warning C4018: '>' : signed/unsigned mismatch
d:\UltraVNC\ultravnc\winvnc\winvnc\vncEncodeUltra.cpp(365): warning C4018: '>' : signed/unsigned mismatch
d:\UltraVNC\ultravnc\winvnc\winvnc\vncencoderre.cpp(273): warning C4018: '<' : signed/unsigned mismatch
d:\UltraVNC\ultravnc\winvnc\winvnc\vncencodecorre.cpp(132): warning C4018: '>' : signed/unsigned mismatch
d:\UltraVNC\ultravnc\winvnc\winvnc\vncencodecorre.cpp(150): warning C4018: '>' : signed/unsigned mismatch
d:\UltraVNC\ultravnc\winvnc\winvnc\vncencodecorre.cpp(223): warning C4018: '>' : signed/unsigned mismatch
d:\UltraVNC\ultravnc\winvnc\winvnc\vncencodecorre.cpp(243): warning C4018: '>' : signed/unsigned mismatch
d:\UltraVNC\ultravnc\winvnc\winvnc\vncencodecorre.cpp(299): warning C4018: '<' : signed/unsigned mismatch
d:\UltraVNC\ultravnc\winvnc\winvnc\vncdesktopthread.cpp(131): warning C4018: '<=' : signed/unsigned mismatch
d:\UltraVNC\ultravnc\winvnc\winvnc\vncdesktopthread.cpp(144): warning C4018: '<=' : signed/unsigned mismatch
d:\UltraVNC\ultravnc\winvnc\winvnc\vncdesktopthread.cpp(332): warning C4800: 'BOOL' : forcing value to bool 'true' or 'false' (performance warning)
d:\UltraVNC\ultravnc\winvnc\winvnc\vncdesktopthread.cpp(458): warning C4800: 'BOOL' : forcing value to bool 'true' or 'false' (performance warning)
d:\UltraVNC\ultravnc\winvnc\winvnc\vncdesktopthread.cpp(816): warning C4800: 'BOOL' : forcing value to bool 'true' or 'false' (performance warning)
d:\UltraVNC\ultravnc\winvnc\winvnc\vncdesktop.cpp(431): warning C4805: '==' : unsafe mix of type 'BOOL' and type 'bool' in operation
d:\UltraVNC\ultravnc\winvnc\winvnc\vncdesktop.cpp(1409): warning C4005: 'CAPTUREBLT' : macro redefinition
        C:\Programme\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\WinGDI.h(86) : see previous definition of 'CAPTUREBLT'
d:\UltraVNC\ultravnc\winvnc\winvnc\vncdesktop.cpp(1789): warning C4018: '<' : signed/unsigned mismatch
d:\UltraVNC\ultravnc\winvnc\winvnc\vncdesktop.cpp(2045): warning C4800: 'BOOL' : forcing value to bool 'true' or 'false' (performance warning)
d:\UltraVNC\ultravnc\winvnc\winvnc\vncclient.cpp(1044): warning C4018: '<' : signed/unsigned mismatch
d:\UltraVNC\ultravnc\winvnc\winvnc\vncclient.cpp(1474): warning C4800: 'CARD8' : forcing value to bool 'true' or 'false' (performance warning)
d:\UltraVNC\ultravnc\winvnc\winvnc\vncclient.cpp(2192): warning C4018: '<' : signed/unsigned mismatch
d:\UltraVNC\ultravnc\winvnc\winvnc\vncclient.cpp(3267): warning C4018: '<' : signed/unsigned mismatch
d:\UltraVNC\ultravnc\winvnc\winvnc\vncclient.cpp(3404): warning C4018: '<' : signed/unsigned mismatch
d:\UltraVNC\ultravnc\winvnc\winvnc\vncclient.cpp(3432): warning C4018: '<' : signed/unsigned mismatch
d:\UltraVNC\ultravnc\winvnc\winvnc\vncbuffer.cpp(387): warning C4018: '<' : signed/unsigned mismatch
d:\UltraVNC\ultravnc\winvnc\winvnc\vncbuffer.cpp(411): warning C4018: '<' : signed/unsigned mismatch
d:\UltraVNC\ultravnc\winvnc\winvnc\vncbuffer.cpp(485): warning C4018: '<' : signed/unsigned mismatch
d:\UltraVNC\ultravnc\winvnc\winvnc\vncbuffer.cpp(510): warning C4018: '<' : signed/unsigned mismatch
d:\UltraVNC\ultravnc\winvnc\winvnc\vncbuffer.cpp(727): warning C4018: '<' : signed/unsigned mismatch
d:\UltraVNC\ultravnc\winvnc\winvnc\vncbuffer.cpp(729): warning C4018: '<' : signed/unsigned mismatch
d:\UltraVNC\ultravnc\winvnc\winvnc\vncbuffer.cpp(732): warning C4018: '<' : signed/unsigned mismatch
d:\UltraVNC\ultravnc\winvnc\winvnc\vncbuffer.cpp(759): warning C4018: '<' : signed/unsigned mismatch
d:\UltraVNC\ultravnc\winvnc\winvnc\vncbuffer.cpp(761): warning C4244: '=' : conversion from 'unsigned long' to 'BYTE', possible loss of data
d:\UltraVNC\ultravnc\winvnc\winvnc\vncbuffer.cpp(827): warning C4018: '<' : signed/unsigned mismatch
d:\UltraVNC\ultravnc\winvnc\winvnc\vncbuffer.cpp(835): warning C4018: '<' : signed/unsigned mismatch
d:\UltraVNC\ultravnc\winvnc\winvnc\vncbuffer.cpp(836): warning C4244: '=' : conversion from 'unsigned long' to 'BYTE', possible loss of data
d:\UltraVNC\ultravnc\winvnc\winvnc\vncbuffer.cpp(1094): warning C4805: '==' : unsafe mix of type 'BOOL' and type 'bool' in operation
d:\UltraVNC\ultravnc\winvnc\winvnc\vncbuffer.cpp(1095): warning C4805: '==' : unsafe mix of type 'BOOL' and type 'bool' in operation
d:\UltraVNC\ultravnc\winvnc\winvnc\vncbuffer.cpp(1096): warning C4805: '==' : unsafe mix of type 'BOOL' and type 'bool' in operation
d:\UltraVNC\ultravnc\winvnc\winvnc\vncbuffer.cpp(1096): warning C4805: '==' : unsafe mix of type 'BOOL' and type 'bool' in operation
d:\UltraVNC\ultravnc\winvnc\winvnc\vncauth.c(59): warning C4018: '<' : signed/unsigned mismatch
d:\UltraVNC\ultravnc\winvnc\winvnc\vncauth.c(155): warning C4018: '<' : signed/unsigned mismatch
d:\UltraVNC\ultravnc\winvnc\winvnc\videodrivercheck.cpp(104): warning C4800: 'BOOL' : forcing value to bool 'true' or 'false' (performance warning)
d:\UltraVNC\ultravnc\winvnc\winvnc\tableinitcmtemplate.cpp(72): warning C4018: '<' : signed/unsigned mismatch
d:\UltraVNC\ultravnc\winvnc\winvnc\tableinitcmtemplate.cpp(72): warning C4018: '<' : signed/unsigned mismatch
d:\UltraVNC\ultravnc\winvnc\winvnc\tableinitcmtemplate.cpp(72): warning C4018: '<' : signed/unsigned mismatch
d:\UltraVNC\ultravnc\winvnc\winvnc\security.cpp(45): warning C4800: 'BOOL' : forcing value to bool 'true' or 'false' (performance warning)
d:\UltraVNC\ultravnc\winvnc\winvnc\security.cpp(53): warning C4800: 'BOOL' : forcing value to bool 'true' or 'false' (performance warning)
d:\UltraVNC\ultravnc\winvnc\winvnc\security.cpp(129): warning C4800: 'BOOL' : forcing value to bool 'true' or 'false' (performance warning)
d:\UltraVNC\ultravnc\Xregion\region.h(62): warning C4005: 'MAXSHORT' : macro redefinition
d:\UltraVNC\ultravnc\Xregion\region.h(63): warning C4005: 'MINSHORT' : macro redefinition
d:\UltraVNC\ultravnc\winvnc\winvnc\rfbRegion_X11.cxx(150): warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
d:\UltraVNC\ultravnc\winvnc\winvnc\rfbRegion_X11.cxx(154): warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning)
d:\UltraVNC\ultravnc\winvnc\winvnc\rfbRegion_win32.cpp(68): warning C4018: '>' : signed/unsigned mismatch
d:\UltraVNC\ultravnc\winvnc\winvnc\rfbRegion_win32.cpp(60): warning C4101: 'r' : unreferenced local variable
d:\UltraVNC\ultravnc\winvnc\winvnc\rfbRegion_win32.cpp(203): warning C4018: '<' : signed/unsigned mismatch
d:\UltraVNC\ultravnc\winvnc\winvnc\rfbRegion_win32.cpp(305): warning C4800: 'BOOL' : forcing value to bool 'true' or 'false' (performance warning)
D:\UltraVNC\ultravnc\DSMPlugin\DSMPlugin.cpp(297): warning C4800: 'BOOL' : forcing value to bool 'true' or 'false' (performance warning)
D:\UltraVNC\ultravnc\DSMPlugin\DSMPlugin.cpp(356): warning C4800: 'BOOL' : forcing value to bool 'true' or 'false' (performance warning)
d:\UltraVNC\ultravnc\winvnc\winvnc\d3des.c(182): warning C4244: '=' : conversion from 'unsigned long' to 'unsigned char', possible loss of data
d:\UltraVNC\ultravnc\winvnc\winvnc\d3des.c(183): warning C4244: '=' : conversion from 'unsigned long' to 'unsigned char', possible loss of data
d:\UltraVNC\ultravnc\winvnc\winvnc\d3des.c(184): warning C4244: '=' : conversion from 'unsigned long' to 'unsigned char', possible loss of data
d:\UltraVNC\ultravnc\winvnc\winvnc\d3des.c(185): warning C4244: '=' : conversion from 'unsigned long' to 'unsigned char', possible loss of data
d:\UltraVNC\ultravnc\winvnc\winvnc\d3des.c(186): warning C4244: '=' : conversion from 'unsigned long' to 'unsigned char', possible loss of data
d:\UltraVNC\ultravnc\winvnc\winvnc\d3des.c(187): warning C4244: '=' : conversion from 'unsigned long' to 'unsigned char', possible loss of data
d:\UltraVNC\ultravnc\winvnc\winvnc\d3des.c(188): warning C4244: '=' : conversion from 'unsigned long' to 'unsigned char', possible loss of data
d:\UltraVNC\ultravnc\winvnc\winvnc\d3des.c(189): warning C4244: '=' : conversion from 'unsigned long' to 'unsigned char', possible loss of data
d:\UltraVNC\ultravnc\winvnc\winvnc\black_layered.cpp(13): warning C4005: 'LWA_COLORKEY' : macro redefinition
d:\UltraVNC\ultravnc\winvnc\winvnc\black_layered.cpp(14): warning C4005: 'LWA_ALPHA' : macro redefinition
And here is the viewer.exe release version compilation:

Code: Select all

libjpeg Command line warning D4002 : ignoring unknown option '/Qip'
libjpeg Command line warning D4002 : ignoring unknown option '/O3'
libjpeg Command line warning D4002 : ignoring unknown option '/QaxM'
d:\UltraVNC\ultravnc\vncviewer\omnithread\nt.cpp(472): warning C4297: 'omni_thread_wrapper' : function assumed not to throw an exception but does
rdr Command line warning D4002 : ignoring unknown option '/O3'
rdr Command line warning D4002 : ignoring unknown option '/QaxM'
rdr Command line warning D4002 : ignoring unknown option '/Qip'
d:\UltraVNC\ultravnc\vncviewer\VNCOptions.cpp(1196): warning C4800: 'UINT' : forcing value to bool 'true' or 'false' (performance warning)
d:\UltraVNC\ultravnc\vncviewer\VNCOptions.cpp(1250): warning C4800: 'UINT' : forcing value to bool 'true' or 'false' (performance warning)
d:\UltraVNC\ultravnc\vncviewer\VNCOptions.cpp(1260): warning C4800: 'UINT' : forcing value to bool 'true' or 'false' (performance warning)
d:\UltraVNC\ultravnc\vncviewer\FileTransfer.cpp(600): warning C4244: 'initializing' : conversion from '__int64' to 'unsigned long', possible loss of data
d:\UltraVNC\ultravnc\vncviewer\FileTransfer.cpp(606): warning C4244: 'initializing' : conversion from '__int64' to 'unsigned long', possible loss of data
d:\UltraVNC\ultravnc\vncviewer\FileTransfer.cpp(1376): warning C4018: '<' : signed/unsigned mismatch
d:\UltraVNC\ultravnc\vncviewer\FileTransfer.cpp(2100): warning C4244: 'argument' : conversion from '__int64' to 'DWORD', possible loss of data
d:\ultravnc\ultravnc\vncviewer\filetransfer.cpp(2041): warning C4715: 'FileTransfer::AbortFileReception' : not all control paths return a value
d:\ultravnc\ultravnc\vncviewer\filetransfer.cpp(2543): warning C4715: 'FileTransfer::FinishFileSending' : not all control paths return a value
d:\ultravnc\ultravnc\vncviewer\filetransfer.cpp(1982): warning C4715: 'FileTransfer::FinishFileReception' : not all control paths return a value
d:\ultravnc\ultravnc\vncviewer\filetransfer.cpp(2336): warning C4715: 'FileTransfer::SendFile' : not all control paths return a value
d:\ultravnc\ultravnc\vncviewer\filetransfer.cpp(1918): warning C4715: 'FileTransfer::ReceiveFileChunk' : not all control paths return a value
D:\UltraVNC\ultravnc\DSMPlugin\DSMPlugin.cpp(297): warning C4800: 'BOOL' : forcing value to bool 'true' or 'false' (performance warning)
D:\UltraVNC\ultravnc\DSMPlugin\DSMPlugin.cpp(356): warning C4800: 'BOOL' : forcing value to bool 'true' or 'false' (performance warning)
d:\UltraVNC\ultravnc\vncviewer\ClientConnectionZlib.cpp(279): warning C4018: '<' : signed/unsigned mismatch
d:\UltraVNC\ultravnc\vncviewer\ClientConnectionUltra.cpp(83): warning C4018: '<' : signed/unsigned mismatch
d:\UltraVNC\ultravnc\vncviewer\ClientConnectionFile.cpp(195): warning C4800: 'UINT' : forcing value to bool 'true' or 'false' (performance warning)
d:\UltraVNC\ultravnc\vncviewer\ClientConnectionCacheRect.cpp(163): warning C4018: '<' : signed/unsigned mismatch
d:\UltraVNC\ultravnc\vncviewer\ClientConnection.cpp(1695): warning C4800: 'BOOL' : forcing value to bool 'true' or 'false' (performance warning)
d:\UltraVNC\ultravnc\vncviewer\ClientConnection.cpp(3128): warning C4101: 'e' : unreferenced local variable
d:\UltraVNC\ultravnc\vncviewer\ClientConnection.cpp(4219): warning C4244: 'initializing' : conversion from '__int64' to 'unsigned long', possible loss of data
d:\UltraVNC\ultravnc\vncviewer\ClientConnection.cpp(4225): warning C4244: 'initializing' : conversion from '__int64' to 'unsigned long', possible loss of data
d:\UltraVNC\ultravnc\vncviewer\ClientConnection.cpp(4412): warning C4244: 'argument' : conversion from '__int64' to 'UINT', possible loss of data
d:\UltraVNC\ultravnc\vncviewer\ClientConnection.cpp(4413): warning C4244: 'argument' : conversion from '__int64' to 'UINT', possible loss of data
d:\UltraVNC\ultravnc\vncviewer\ClientConnection.cpp(4778): warning C4805: '!=' : unsafe mix of type 'int' and type 'bool' in operation
d:\UltraVNC\ultravnc\vncviewer\ClientConnection.cpp(5262): warning C4805: '==' : unsafe mix of type 'BOOL' and type 'bool' in operation
Don't take this as criticism, just meant to be a good advice :)
Last edited by netwolf on 2005-03-08 18:44, edited 2 times in total.
UltraSam
Admin & Developer
Admin & Developer
Posts: 462
Joined: 2004-04-26 20:55
Contact:

Post by UltraSam »

Yep, we know.

Most warnings will be normally solved before V1 release.
Warning cleaning is the kind of thing that I personnly do once all functionnalities are implemented and when all major bugs are fixed.

Yep the RC20 exe size is big. It's due to compilation options and to the compiler that is used. Big size but should also be faster...
UltraSam
netwolf
40
40
Posts: 112
Joined: 2004-05-13 11:33

Post by netwolf »

Ok, I see.
Everybody has his own programming style I guess :)

btw: there've also been some errors regarding some [language].dsp files that seemed to be corrupt...

Could you please tell me what compiler optimizations you use?
As I'd like to be as up to date as possible (by compiling CVS sources) but still not miss any possible performance improvements...

Or are they specific to the compiler you use (and which I assume is not VC++.NET :) ) ?
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6883
Joined: 2004-04-23 10:21
Contact:

Post by Rudi De Vos »

688k 800k (MS/Intel)
INtel generate seperate code for plain/MMX/SSE and put them all together in 1 exe. On execution level the correct version is used.
Faster then VC6, special on parts that can be vectorized.

Redefenitions needed to compile without SDK (VC6)
some other for BC
w2k3 already have the headers

Type conversions
Sometimes just needed, other can possible be eliminated.

Is there a speed difference, w2K3 compiler faster ?
netwolf
40
40
Posts: 112
Joined: 2004-05-13 11:33

Post by netwolf »

Yeah, I know those redefinitions are not problematic.
Also signed/unsigned is not crucial, but avoiding those warnings may help to prevent bugs, and sometimes (e.g. if you compare stuff, use uint32 in loops rather than uint16...) it's also performance-wise better to compare variables of the same type (but I'm sure I don't tell you anything new here :) )

Regarding conversion: if they are needed, I just think that it's better (especially in C++ opposed to C) to use explicit casts (reinterpret_cast, static_cast...).

I didn't dare to use the self combined exe so far as I'm about 200km away from the server and it's running so great with RC20 right now that I don't want to risk breaking it 8)
User avatar
Rudi De Vos
Admin & Developer
Admin & Developer
Posts: 6883
Joined: 2004-04-23 10:21
Contact:

Post by Rudi De Vos »

Understand,
And running the server at home with the viewer remote would
result in a viewer in a viewer.
Hard to measure any difference.
Post Reply