Tk Source Code

View Ticket
Login
Ticket UUID: 916c1095438eae56481728fc69278c84a4f2ea62
Title: Tk does not compile because GetVersionExW triggers warnings
Type: Bug Version:
Submitter: fvogel Created on: 2015-10-17 13:55:09
Subsystem: 85. Win Build Assigned To: jan.nijtmans
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2015-10-25 19:27:04
Resolution: Fixed Closed By: jan.nijtmans
    Closed on: 2015-10-25 19:27:04
Description:

This is with Visual Express 2015 (in French, sorry):

tkWinMenu.c

D:\tcltk-fossil\tk\win\..\win\tkWinMenu.c(3218): error C2220: avertissement considéré comme une erreur - aucun fichier 'object' généré

D:\tcltk-fossil\tk\win\..\win\tkWinMenu.c(3218): warning C4996: 'GetVersionExW': a été déclaré déconseillé

C:\Program Files (x86)\Windows Kits\8.1\include\um\sysinfoapi.h(442): note: voir la déclaration de 'GetVersionExW'

tkWinX.c

D:\tcltk-fossil\tk\win\..\win\tkWinX.c(132): error C2220: avertissement considéré comme une erreur - aucun fichier 'object' généré

D:\tcltk-fossil\tk\win\..\win\tkWinX.c(132): warning C4996: 'GetVersionExW': a été déclaré déconseillé

C:\Program Files (x86)\Windows Kits\8.1\include\um\sysinfoapi.h(442): note: voir la déclaration de 'GetVersionExW'

D:\tcltk-fossil\tk\win\..\win\tkWinX.c(345): warning C4996: 'GetVersionExW': a été déclaré déconseillé

C:\Program Files (x86)\Windows Kits\8.1\include\um\sysinfoapi.h(442): note: voir la déclaration de 'GetVersionExW'

ttkWinXPTheme.c

D:\tcltk-fossil\tk\win\..\win\ttkWinXPTheme.c(1265): error C2220: avertissement considéré comme une erreur - aucun fichier 'object' généré

D:\tcltk-fossil\tk\win\..\win\ttkWinXPTheme.c(1265): warning C4996: 'GetVersionExW': a été déclaré déconseillé

C:\Program Files (x86)\Windows Kits\8.1\include\um\sysinfoapi.h(442): note: voir la déclaration de 'GetVersionExW'

Génération de code en cours...

NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.EXE"' : code retour '0x2'

Stop.

Is it possible that this commit has introduced this problem (I didn't bisect to be sure)?

User Comments: jan.nijtmans added on 2015-10-25 19:27:04:

Fix backported from Tk8.6. Thanks!

In fact, this is indeed a workaround, not a fix. Most uses of GetVersionExW() just check whether we are running XP or later. Since we still need to support XP and VC++ 6, there is simply no other way than using GetVersionExW().


fvogel added on 2015-10-23 16:16:58:
Seen [f51c25b1] (for 8.5) and [1c527b74] (for trunk), thanks for the workaround (is it really a fix?).

Now the trunk compiles for me with Visual Express 2015.

However, core-8-5-branch does not because of the following:

D:\tcltk-fossil\tk\win\..\win\ttkWinXPTheme.c(31): fatal error C1083: Impossible d'ouvrir le fichier include : 'tmschema.h' : No such file or directory
Génération de code en cours...
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.EXE"' : code retour '0x2'
Stop.

Forcing inclusion of    <vssym32.h>
even when    HAVE_VSSYM32_H     is not defined makes it compile.