godot icon indicating copy to clipboard operation
godot copied to clipboard

Strange output on debug console.

Open NullNeska opened this issue 10 years ago • 6 comments

Operating system or device - Godot version: https://github.com/godotengine/godot/commit/2cf781d3c66cbc53739ff91d4608ac979ae17262 windows 10 64 bit, compiled with mingw-64

Issue description (what happened, and what was expected): Booted up the compiled executable, strange text in output. made a quick test with printing text, text displayed in engine output but not the cmd output. getting strange gibberish instead 4kieepj

Steps to reproduce: scons platform=windows wait for compile, compile finishs launch godot.

Link to minimal example project (optional but very welcome):

NullNeska avatar Aug 23 '16 08:08 NullNeska

Operating system or device - Godot version:

Same issue with: Built for Windows 7 and Godot 64 Bit MinGW-w64 with gcc 4.8.3 Godot 2.1 branch (commit 9c8ecb45f8) Godot master branch

godot gcc4 8 3-non-sense

Commits:

commit 5b27f05e7e Godot 2.1 branch OR commit f28ff8a208 Godot master branch

Discussion here: #7116 @akien-mga

Fixing this issue at gcc 4.8.3 with reverting the above mentioned commits:

or in other words, using lowercase %s

#ifdef __MINGW32__
	if (p_stderr)
		fwprintf(stderr, L"%s", wbuf);
	else
		wprintf(L"%s", wbuf);
#else // MSVC

godot gcc4 8 3

(note: compiling without ssl support)

ede-krcv avatar Jan 14 '17 20:01 ede-krcv

So this is dependent on GCC version?

vnen avatar Jan 15 '17 01:01 vnen

Maybe. If we would know which compiler version @jay3d and @FlavoredCactus are using

ede-krcv avatar Jan 15 '17 19:01 ede-krcv

I wish i remembered. since this incident i started using linux to compile since its must easier. according to my original post it was compiled with mingw-64

NullNeska avatar Jan 16 '17 08:01 NullNeska

Someone with both MSVC and MinGW needs to look into this and find the proper formats :) http://stackoverflow.com/questions/17700797/printf-wprintf-s-s-ls-char-and-wchar-errors-not-announced-by-a-compil

akien-mga avatar Jan 16 '17 08:01 akien-mga

Someone with both MSVC and MinGW needs to look into this and find the proper formats :)

I think the proper way should be to use %ls which specifies the compiler that the parameter is a pointer to a wchar_t, so no matter what compiler/standard library we use it should work. See cpp reference, conversion specifier 's':

If the l specifier is used, the argument must be a pointer to the initial element of an array of wchar_t. 

It seems to compile and output just fine with both MinGW and MSVC (although I was affected by this bug, so the original poster of #7116 could double check)

Faless avatar Jan 16 '17 17:01 Faless