Re: [Tuxpaint-devel] Hidden bug on Windows?
An award-winning drawing program for children of all ages
Brought to you by:
wkendrick
|
From: TOYAMA Shin-i. <sh...@wm...> - 2021-10-17 08:20:12
|
Hi,
I investigated more to understand why this happened by checking
original 0.9.26's code.
In old build system for Windows 2000/XP,
----------------
msys:$ make obj/onscreen_keyboard.o
...Compiling on screen keyboard support...
msys:$
----------------
You see no warning and no error.
However, in the latest MinGW/MSYS2 build environment,
----------------
mingw64:$ make obj/onscreen_keyboard.o
...Compiling on screen keyboard support...
src/onscreen_keyboard.c: In function 'mtw':
src/onscreen_keyboard.c:76:16: warning: passing argument 2 of 'libiconv' from
incompatible pointer type [-Wincompatible-pointer-types]
76 | iconv(trans, (const char **)&tok, &in, &wrptr, &out);
| ^~~~~~~~~~~~~~~~~~~
| |
| const char **
In file included from src/onscreen_keyboard.c:55:
C:/msys64/mingw64/include/iconv.h:82:43: note: expected 'char **' but argument
is of type 'const char **'
82 | extern size_t iconv (iconv_t cd, char* * inbuf, size_t *inbytesleft,
char* * outbuf, size_t *outbytesleft);
| ~~~~~~~~^~~~~
src/onscreen_keyboard.c:78:18: warning: passing argument 2 of 'swprintf' makes
integer from pointer without a cast [-Wint-conversion]
78 | swprintf(wtok, L"%ls", ui16);
| ^~~~~~
| |
| const short unsigned int *
In file included from C:/msys64/mingw64/x86_64-w64-mingw32/include/wchar.h:1192,
from src/onscreen_keyboard.h:1,
from src/onscreen_keyboard.c:23:
C:/msys64/mingw64/x86_64-w64-mingw32/include/swprintf.inl:34:41: note: expected
'size_t' {aka 'long long unsigned int'} but argument is of type 'const short
unsigned int *'
34 | int swprintf (wchar_t *__stream, size_t __count, const wchar_t
*__format, ...)
| ~~~~~~~^~~~~~~
src/onscreen_keyboard.c:66:10: warning: variable 'n' set but not used
[-Wunused-but-set-variable]
66 | size_t n, in, out;
| ^
mingw64:$
----------------
Interestingly, changing the second argument of 'swprintf()' to
the integer valiable results completely the opposite.
This result says that the type of second argument to swprintf()
becomes completely different in MinGW/MSYS2.
Although I am not sure why this works on Windows 8 and before,
it must be one of the reason for the crash on Windows10.
And you see another warning regarding iconv() which is now
unused in onscreen_keyboard.c but still used in tuxpaint.c
Until now, I have just ignored such warnings when compiling
TuxPaint on windows, but it might be better to look them more
carefully and try to reduce warnings as possible I can.
Thanks!
TOYAMA Shin-ichi wrote in
<616b70f2.4975%sh...@wm...>
>Hi Bill,
>
>Pere Pujal i Carabantes wrote in
><041...@gm...>
>>> Packages compiled as 0.9.26-5 are available in
>>>
>>> https://z1.plala.jp/tuxpaint/release/0.9.26-5/ (5!!)
>>>
>>> Could you give them final tests ?
>>> I pray that this will work out this time.
>>
>>As far as I've tested it works fine in W10:
>>No need to enable compatibility to W8 to make it running.
>>No crashes with labels.
>>No crashes with onscreen keyboard.
>>Drawings can be exported/imported from/to Linux/Windows without
>>labels being corrupted.
>
>So, I believe those two crash bug on windows10 have been fixed
>finally.
>
>By the way, patched 0.9.26 also compiled on the old build system
>for 2000 and XP, but it did not run.
>Then, I think that the initial tweak for windows on the OSK was
>not a mistake.
>
>I guess that this bug has been existing since when I changed the
>build system to MinGW/MSYS2 and become apparent in Windows10.
>
>I think every windows user, except XP/2000, would be suggested
>to upgrade to 0.9.26-5.
>
>Thanks.
--
TOYAMA Shin-ichi mailto:sh...@wm...
|