Tk Source Code

View Ticket
Login
Ticket UUID: ca7d87db31fc2a4ce48a04e7716a8800436ec840
Title: core-8-6-branch: Compile warnings with 32bit MS-VC++ 6
Type: Bug Version: core-8-6-branch
Submitter: oehhar Created on: 2026-10-28 17:33:38
Subsystem: 81. Portability Assigned To: nobody
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2026-10-29 16:01:07
Resolution: Fixed Closed By: oehhar
    Closed on: 2026-10-29 16:01:07
Description:

I compiled today core-8-6-branch using MS-VC6++ in 32 bit mode. Yes, 8.6. should compile with this dinosaur...

Here are the errors:

win\tkWinTest.c(734) : error C2065: 'MAPVK_VK_TO_VSC' : undeclared identifier

This is fixed by commit [81d65a26].

Here are the warnings:

generic\tkCanvas.c(4275) : warning C4022: 'memcpy' : pointer mismatch for actual parameter 1
win\tkWinFont.c(1499) : warning C4761: integral size mismatch in argument; conversion supplied
win\tkWinFont.c(1521) : warning C4761: integral size mismatch in argument; conversion supplied
win\tkWinWm.c(1698) : warning C4018: '!=' : signed/unsigned mismatch
eneric\ttk\ttkFrame.c(175) : warning C4005: 'DEFAULT_BORDERWIDTH' : macro redefinition
generic\ttk\ttkClassicTheme.c(0) : see previous definition of 'DEFAULT_BORDERWIDTH'

Take care, Harald

User Comments: oehhar added on 2026-10-29 16:01:07:

Thanks!

Christopher and Jans proposal merged by commit [4b72b50e] to core-8-6-branch.

Thanks!

Harald


jan.nijtmans added on 2026-10-29 10:09:20:

How about (in tkCanvas.c):

#if defined(_MSC_VER) && _MSC_VER < 1300
#   pragma warning(disable:4022)
#endif


oehhar added on 2026-10-29 09:47:30:

Thanks for looking into this. I think, the memcopy one is a bit radical just to avoid a warning. I will test the others probably tonight or next Monday.

Thanks again, Harald


chrstphrchvz added on 2026-10-29 09:11:08:

Jan and Donal have tried to deal with spurious warnings from that specific memcpy() call for over 19 years now (since [940015b1]). At this point, maybe consider just using a for-loop copy, as already done in Tk_CanvasTagsParseProc(). Although I wonder if these are where `ckrealloc()` should be used instead.

My guess is that the warnings in tkWinFont.c are due to a double being passed to a function expecting int; casts were previously added in [a07518dc] to address warnings for similar arguments. And I think adding a cast which is consistent with nearby code should resolve the warning in tkWinWm.c.

I will push a branch called bug-ca7d87db-c86b with some suggestions. I have not tried compiling Tcl/Tk on Windows in a while, however.