AlloSphere-Research-Group / allolib

Library for interactive multimedia application development
BSD 3-Clause "New" or "Revised" License
36 stars 14 forks source link

Windows + Git Bash + Visual Studio C++ | build output is insanely noisy #14

Open kybr opened 5 years ago

kybr commented 5 years ago

I'm on Windows 10. I've installed git, cmake, and visual studio using chocolatey:

choco install git -y 
choco install cmake -y --installargs 'ADD_CMAKE_TO_PATH=System'
choco install visualstudio2017-workload-vctools -y --package-parameters "--includeRecommended"

In this environment, the output of a successful execution of the run script dumps a LOT of noisy text into the terminal (like a bzillion very long lines). On the first execution that builds the whole of AlloLib, vctools spits out over 3 thousand warnings. Upon subsequent executions, a particular example might only dump 250 warnings. I think it might be useful for developers to actually look at some of these warnings, but I think that for users, these are just noise.

younkhg commented 5 years ago

I tried compiling and also got lot of warnings (total number of about 560):

https://gist.github.com/younkhg/2d5c25ff288c53d1642d2b1be23e942f

I removed duplicate warning code from the list (with sample message) and it came down to:

warning C4244: 'return': conversion from 'float' to 'gam::index_t', possible loss of data warning C4267: 'initializing': conversion from 'size_t' to 'int', possible loss of data warning C4305: 'initializing': truncation from 'double' to 'float' warning C4477: 'fprintf' : format string '%8lu' requires an argument of type 'unsigned long', but variadic argument 1 has type 'unsigned __int64' warning C4101: 'e': unreferenced local variable warning C4996: 'strncpy': This function or variable may be unsafe. Consider using strncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. warning C4005: 'M_E': macro redefinition warning C4146: unary minus operator applied to unsigned type, result still unsigned warning C4099: 'al::Thread::Impl': type name first seen using 'struct' now seen using 'class' warning C4312: 'type cast': conversion from 'unsigned long' to 'HANDLE' of greater size warning C4804: '-': unsafe use of type 'bool' in operation warning C4028: formal parameter 1 different from declaration

C4244, C4267, and C4305 seems to be trivial warnings we can set ignore and number of those are:

C4244: 282 C4267: 187 C4305: 13

I think we can suppress C4244, C4267, and C4305 and for other warnings I think we should try to fix the code. Also the warnings that come from headers are first to be fixed since it will appear again when compiling user project.

I can add some lines to cmake script to suppress C4244, C4267, and C4305 on MSVC if I get more agreement. It should be trivial.

mantaraya36 commented 4 years ago

I have removed most warnings for the debug build. Still very noisy, but good enough. We should now concentrate on changing code for remaining warnings.