how to disable debug print?

Discuss the future of Warzone 2100 with us.

how to disable debug print?

Postby andrvaut » 20 May 2018, 17:29

At me in the console in the last master messages constantly look like:
Code: Select all
Build (F3)
Research - build research facility first
Manufacture - build factory first
Research Facility
Cost: 100

how to disable it?

I'm trying to test the game with clan -fsanitize=undefined
Already saw warnings:
Code: Select all
frameresource.cpp:801:5: runtime error: call to function (unknown) through pointer to incorrect function type 'void (*)(void *)'
(/opt/warzone2100/src/warzone2100+0xe2f3e0): note: (unknown) defined here
qtscriptfuncs.cpp:2579:11: runtime error: nan is outside the range of representable values of type 'int'
qtscriptfuncs.cpp:2580:11: runtime error: nan is outside the range of representable values of type 'int'
qtscriptfuncs.cpp:2581:32: runtime error: signed integer overflow: 34 - -2147483648 cannot be represented in type 'int'
qtscriptfuncs.cpp:2581:41: runtime error: signed integer overflow: 50 - -2147483648 cannot be represented in type 'int'
geometry.cpp:106:68: runtime error: signed integer overflow: -32477 * -73723 cannot be represented in type 'int'
../lib/framework/vector.h:63:13: runtime error: signed integer overflow: -73723 * -73723 cannot be represented in type 'int'
../lib/framework/vector.h:63:19: runtime error: signed integer overflow: 1140113433 + 1054950400 cannot be represented in type 'int'
geometry.cpp:132:47: runtime error: signed integer overflow: 128 * -2151426864618083952 cannot be represented in type 'long'
geometry.cpp:105:46: runtime error: signed integer overflow: 102829 * 32684 cannot be represented in type 'int'
../lib/framework/vector.h:63:25: runtime error: signed integer overflow: 112708 * -29535 cannot be represented in type 'int'
geometry.cpp:106:51: runtime error: signed integer overflow: 5378956 * -9761 cannot be represented in type 'int'
geometry.cpp:105:63: runtime error: signed integer overflow: 13158 * 989007 cannot be represented in type 'int'
frameresource.cpp:835:6: runtime error: call to function (unknown) through pointer to incorrect function type 'void (*)(void *)'
(/opt/warzone2100/src/warzone2100+0xe2f3e0): note: (unknown) defined here
radar.cpp:329:17: runtime error: -nan is outside the range of representable values of type 'unsigned char'
radar.cpp:328:17: runtime error: -nan is outside the range of representable values of type 'unsigned char'
radar.cpp:330:17: runtime error: -nan is outside the range of representable values of type 'unsigned char'
display3d.cpp:3338:122: runtime error: -179.994 is outside the range of representable values of type 'unsigned short'
display3d.cpp:1292:21: runtime error: division by zero
display3d.cpp:3233:21: runtime error: division by zero
display3d.cpp:3257:30: runtime error: inf is outside the range of representable values of type 'unsigned int'



printing of information messages complicates the work
vaut ΣΑ [GN], ru streamer.
Tournaments channel: https://www.youtube.com/channel/UCzusNa-54ydodtSz2TdHFww
User avatar
andrvaut
Trained
Trained
 
Posts: 74
Joined: 02 Jan 2016, 12:44

Re: how to disable debug print?

Postby pastdue » 20 May 2018, 20:12

I presume you are compiling in DEBUG mode?

If so, see debug_init() in debug.cpp, line 286-288:
Code: Select all
#ifdef DEBUG
   enabled_debug[LOG_WARNING] = true;
#endif

You'll want to comment that out.
pastdue
Code contributor
Code contributor
 
Posts: 83
Joined: 13 Aug 2017, 17:44

Re: how to disable debug print?

Postby andrvaut » 20 May 2018, 20:45

I do not need gdb yet, so I compiled this:
Code: Select all
./configure --enable-debug=no  CXXFLAGS="-O2 -fsanitize=undefined" CPPFLAGS="-O2 -fsanitize=undefined"
make CC="clang" CXX="clang++"

In addition to changing the code, there are ways?
vaut ΣΑ [GN], ru streamer.
Tournaments channel: https://www.youtube.com/channel/UCzusNa-54ydodtSz2TdHFww
User avatar
andrvaut
Trained
Trained
 
Posts: 74
Joined: 02 Jan 2016, 12:44

Re: how to disable debug print?

Postby andrvaut » 24 May 2018, 11:08

Commenting the lines did not help.
The interface information is also written.

This problem is not just for me. Phobos also complains about trash:
http://forums.wz2100.net/viewtopic.php?f=6&t=14316
vaut ΣΑ [GN], ru streamer.
Tournaments channel: https://www.youtube.com/channel/UCzusNa-54ydodtSz2TdHFww
User avatar
andrvaut
Trained
Trained
 
Posts: 74
Joined: 02 Jan 2016, 12:44

Re: how to disable debug print?

Postby pastdue » 24 May 2018, 17:14

The errant tooltip debug output should be fixed with: 10101fc19838e67a5d7b8e82a3437df1752fe582
pastdue
Code contributor
Code contributor
 
Posts: 83
Joined: 13 Aug 2017, 17:44

Re: how to disable debug print?

Postby andrvaut » 26 May 2018, 14:40

Thanks
vaut ΣΑ [GN], ru streamer.
Tournaments channel: https://www.youtube.com/channel/UCzusNa-54ydodtSz2TdHFww
User avatar
andrvaut
Trained
Trained
 
Posts: 74
Joined: 02 Jan 2016, 12:44


Return to Development