Skip to content

build.bat --tail-call-interp and errors/warnings in socketmodule #145929

Description

@hunterhogan

Bug report

Bug description:

Running build.bat --tail-call-interp ... leads to 1 error and 10 warnings about "Modules\socketmodule.c" and "Modules\socketmodule.h".

  1. The build fails due to 1 error in "Modules\socketmodule.c."
  2. "\Modules\socketmodule.c" leads to 4 warning : ... is deprecated statements.
  3. "\Modules\socketmodule.h" leads to 5 warning : the current #pragma pack alignment value is modified in the included file [-Wpragma-pack] [C:\Users\hunte\AppData\Local\cpython\PCbuild\FILE.vcxproj] statements, where "FILE" is _freeze_module, _socket, or pythoncore.
  4. The build succeeds if in "Modules\socketmodule.c," I change line 3375 from int dummy; to DWORD dummy;.

Details

  1. Source files: github/python/cpython/3.14
  2. Command build.bat --pgo --tail-call-interp "/p:PlatformToolset=ClangCL" "/p:LLVMInstallDir=%pathCLang%" "/p:LLVMToolsVersion=%LLVMToolsVersion%" "/p:WholeProgramOptimization=true".
  3. Both build.bat -d and build.bat, with the same source files, lead to 1 Warning and 0 Errors c:\clones\cpython\Modules\unicodedata.c(1478,62): warning C4267: 'function': conversion from 'size_t' to 'int', possible loss of data [c:\clones\cpython\PCbuild\unicodedata.vcxproj].
  4. In total, build.bat --tail-call-interp ... leads to 715 warnings and 1 error.
    1. No other errors or warnings refer to a "*.c" or "*.h" file.
    2. One warning states C:\Users\hunte\AppData\Local\cpython\PCbuild\pythoncore.vcxproj(720,5): warning : Toolset ClangCL is not used for official builds. Your build may have errors or incompatibilities.
    3. All other warnings state clang-cl : warning : argument unused during compilation: '/GL' [-Wunused-command-line-argument] [PATHto\cpython\PCbuild\FILE.vcxproj], where "FILE" is one of exactly 45 different names. I think there are 55 "*.vcxproj" files in the directory.

The 1 error and 10 warnings about "Modules\socketmodule.c" and "Modules\socketmodule.h"

..\Modules\socketmodule.c(3377,51): error : incompatible pointer types passing 'int *' to parameter of type 'LPDWORD' (aka 'unsigned long *') [-Wincompatible-pointer-types] [C:\Users\hunte\AppData\Local\cpython\PCbuild\_socket.vcxproj]
..\Modules\socketmodule.c(6208,9): warning : 'gethostbyname' is deprecated: Use getaddrinfo() or GetAddrInfoW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings [-Wdeprecated-declarations] [C:\Users\hunte\AppData\Local\cpython\PCbuild\_socket.vcxproj]
..\Modules\socketmodule.c(6313,9): warning : 'gethostbyaddr' is deprecated: Use getnameinfo() or GetNameInfoW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings [-Wdeprecated-declarations] [C:\Users\hunte\AppData\Local\cpython\PCbuild\_socket.vcxproj]
..\Modules\socketmodule.c(6731,23): warning : 'inet_addr' is deprecated: Use inet_pton() or InetPton() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings [-Wdeprecated-declarations] [C:\Users\hunte\AppData\Local\cpython\PCbuild\_socket.vcxproj]
..\Modules\socketmodule.c(6775,33): warning : 'inet_ntoa' is deprecated: Use inet_ntop() or InetNtop() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings [-Wdeprecated-declarations] [C:\Users\hunte\AppData\Local\cpython\PCbuild\_socket.vcxproj]
..\Modules\socketmodule.h(21,11): warning : the current #pragma pack alignment value is modified in the included file [-Wpragma-pack] [C:\Users\hunte\AppData\Local\cpython\PCbuild\_freeze_module.vcxproj]
..\Modules\socketmodule.h(21,11): warning : the current #pragma pack alignment value is modified in the included file [-Wpragma-pack] [C:\Users\hunte\AppData\Local\cpython\PCbuild\_socket.vcxproj]
..\Modules\socketmodule.h(21,11): warning : the current #pragma pack alignment value is modified in the included file [-Wpragma-pack] [C:\Users\hunte\AppData\Local\cpython\PCbuild\pythoncore.vcxproj]
..\Modules\socketmodule.h(53,11): warning : the current #pragma pack alignment value is modified in the included file [-Wpragma-pack] [C:\Users\hunte\AppData\Local\cpython\PCbuild\_freeze_module.vcxproj]
..\Modules\socketmodule.h(53,11): warning : the current #pragma pack alignment value is modified in the included file [-Wpragma-pack] [C:\Users\hunte\AppData\Local\cpython\PCbuild\_socket.vcxproj]
..\Modules\socketmodule.h(53,11): warning : the current #pragma pack alignment value is modified in the included file [-Wpragma-pack] [C:\Users\hunte\AppData\Local\cpython\PCbuild\pythoncore.vcxproj]

Success

  1. In "Modules\socketmodule.c," I changed line 3375 from int dummy; to DWORD dummy;.
  2. Rerun the build script.
  3. 547 Warnings and 0 Errors.

There are a few different file names between uniqueWarningsBefore.txt and uniqueWarningsAfter.txt if you think it's important.

Information you can almost certainly ignore.

Environment

Microsoft Windows [Version 10.0.26200.8037]

curl 8.18.0 (Windows) libcurl/8.18.0 Schannel zlib/1.3.1 WinIDN WinLDAP

clang version 22.1.1 (https://github.com/llvm/llvm-project fef02d48c08db859ef83f84232ed78bd9d1c323a)
Target: x86_64-pc-windows-msvc
Thread model: posix
InstalledDir: C:\clones\clang_msvc\bin

Python 3.14.3 (tags/v3.14.3:323c59a, Feb 3 2026, 16:04:56) [MSC v.1944 64 bit (AMD64)]

Visual Studio configuration

My batch files to build and install tail-call-interp

_variables.cmd

SETpath314raw=%LOCALAPPDATA%\cpython

go.cmd

@ECHOOFFCALL C:\apps\Z0Z_\buildPython\_variables.cmd
:: LLVM clang versionSETpathCLang=C:\clones\clang_msvc
SETURLreleases=https://github.com/llvm/llvm-project/releases
FOR /F "tokens=3"%%GIN ('%pathCLang%\bin\clang.exe --version ^| findstr clang') DOSETversionLLVM=%%GFOR /F "delims="%%GIN ('curl -L -s -o NUL -w "%%{url_effective}""%URLreleases%/latest"') DOSETURLlatest=%%GFOR /F "tokens=7 delims=/"%%GIN ("%URLlatest%") DOSETLLVMdirectory=%%GSET"versionLLVMlatest=%LLVMdirectory:llvmorg-=%"IFNOT"%versionLLVM%"=="%versionLLVMlatest%" (
IFNOTEXIST%pathCLang%MKDIR%pathCLang%SETpathRelativeLLVM=clang+llvm-%versionLLVMlatest%-x86_64-pc-windows-msvc
SETfilename_tar=%pathRelativeLLVM%.tar
SETfilename_xz=%filename_tar%.xz
curl -L "%URLreleases%/download/%LLVMdirectory%/%filename_xz%" -o "%pathCLang%\%filename_xz%"CALL 7z x -aoa "-o%pathCLang%""%pathCLang%\%filename_xz%"CALL 7z x -aoa "-o%pathCLang%""%pathCLang%\%filename_tar%""%pathRelativeLLVM%\*"ROBOCOPY%pathCLang%\%pathRelativeLLVM%%pathCLang% /MOVE /E /NJH /NDL /NFL
DEL%pathCLang%\%filename_tar%DEL%pathCLang%\%filename_xz%
)
%pathCLang%\bin\clang.exe --version
:: github/python/cpython/3.14 syncPUSHd%path314raw%CALL git checkout 3.14
CALL git pull
POPd:: PCbuild\build.batPUSHd"%path314raw%\PCbuild"FOR /F "tokens=1 delims=."%%GIN ("%versionLLVMlatest%") DOSETLLVMToolsVersion=%%GCALL build.bat --pgo --tail-call-interp "/p:PlatformToolset=ClangCL""/p:LLVMInstallDir=%pathCLang%"^"/p:LLVMToolsVersion=%LLVMToolsVersion%""/p:WholeProgramOptimization=true"@REM -Wno-unused-command-line-argumentPOPd

regedit_copyFiles.cmd

@ECHOOFFCALL C:\apps\Z0Z_\buildPython\_variables.cmd
SETz=z
SETpath314zCompiled=%path314raw%\PCbuild\amd64
SETpath314zInstalled=%LOCALAPPDATA%\Programs\Python\Python314
COPY /Y "%path314zCompiled%\python.exe""%path314zInstalled%\python3.14%z%.exe"COPY /Y "%path314zCompiled%\python.pdb""%path314zInstalled%\python3.14%z%.pdb"COPY /Y "%path314zCompiled%\pythonw.exe""%path314zInstalled%\pythonw3.14%z%.exe"COPY /Y "%path314zCompiled%\pythonw.pdb""%path314zInstalled%\pythonw3.14%z%.pdb"COPY /Y "%path314zCompiled%\python3.*""%path314zInstalled%\python3%z%.*"COPY /Y "%path314zCompiled%\python314.*""%path314zInstalled%\python314%z%.*"MOVE /Y "%path314zInstalled%\*.lib""%path314zInstalled%\libs\""%path314zInstalled%\python3.14%z%.exe" -VV
SET"keyRoot=HKCU\Software\Python\PythonCore\3.14%z%"REG ADD "%keyRoot%" /F /T REG_SZ /V DisplayName /D "Python 3.14 (64-bit, tail-call interpreter)"REG ADD "%keyRoot%" /F /T REG_SZ /V SupportUrl /D "https://www.python.org/"REG ADD "%keyRoot%" /F /T REG_SZ /V Version /D "3.14"REG ADD "%keyRoot%" /F /T REG_SZ /V SysVersion /D "3.14"REG ADD "%keyRoot%" /F /T REG_SZ /V SysArchitecture /D "64bit"REG ADD "%keyRoot%\InstallPath" /F /T REG_SZ /VE /D %path314zInstalled%\
REG ADD "%keyRoot%\InstallPath" /F /T REG_SZ /V ExecutablePath /D "%path314zInstalled%\python3.14%z%.exe"REG ADD "%keyRoot%\InstallPath" /F /T REG_SZ /V WindowedExecutablePath /D "%path314zInstalled%\pythonw3.14%z%.exe"REG ADD "%keyRoot%\PythonPath" /F /T REG_SZ /VE /D %path314zInstalled%\Lib\;%path314zInstalled%\DLLs\
py -0p

45 filenames with warning about unused /GL

_asyncio.vcxproj
_bz2.vcxproj
_ctypes_test.vcxproj
_ctypes.vcxproj
_decimal.vcxproj
_elementtree.vcxproj
_freeze_module.vcxproj
_hashlib.vcxproj
_lzma.vcxproj
_multiprocessing.vcxproj
_overlapped.vcxproj
_queue.vcxproj
_remote_debugging.vcxproj
_socket.vcxproj
_sqlite3.vcxproj
_testbuffer.vcxproj
_testcapi.vcxproj
_testclinic_limited.vcxproj
_testclinic.vcxproj
_testconsole.vcxproj
_testembed.vcxproj
_testimportmultiple.vcxproj
_testinternalcapi.vcxproj
_testlimitedcapi.vcxproj
_testmultiphase.vcxproj
_testsinglephase.vcxproj
_tkinter.vcxproj
_uuid.vcxproj
_wmi.vcxproj
_zoneinfo.vcxproj
_zstd.vcxproj
liblzma.vcxproj
pyexpat.vcxproj
pylauncher.vcxproj
pyshellext.vcxproj
python3dll.vcxproj
pythoncore.vcxproj
pywlauncher.vcxproj
select.vcxproj
sqlite3.vcxproj
unicodedata.vcxproj
venvlauncher.vcxproj
venvwlauncher.vcxproj
winsound.vcxproj
zlib-ng.vcxproj

55 "`*.vcxproj`" files in PCBuild directory

_asyncio.vcxproj
_bz2.vcxproj
_ctypes_test.vcxproj
_ctypes.vcxproj
_decimal.vcxproj
_elementtree.vcxproj
_freeze_module.vcxproj
_hashlib.vcxproj
_lzma.vcxproj
_multiprocessing.vcxproj
_overlapped.vcxproj
_queue.vcxproj
_remote_debugging.vcxproj
_socket.vcxproj
_sqlite3.vcxproj
_ssl.vcxproj
_testbuffer.vcxproj
_testcapi.vcxproj
_testclinic_limited.vcxproj
_testclinic.vcxproj
_testconsole.vcxproj
_testembed.vcxproj
_testimportmultiple.vcxproj
_testinternalcapi.vcxproj
_testlimitedcapi.vcxproj
_testmultiphase.vcxproj
_testsinglephase.vcxproj
_tkinter.vcxproj
_uuid.vcxproj
_wmi.vcxproj
_zoneinfo.vcxproj
_zstd.vcxproj
liblzma.vcxproj
openssl.vcxproj
pyexpat.vcxproj
pylauncher.vcxproj
pyshellext.vcxproj
python_uwp.vcxproj
python.vcxproj
python3dll.vcxproj
pythoncore.vcxproj
pythonw_uwp.vcxproj
pythonw.vcxproj
pywlauncher.vcxproj
select.vcxproj
sqlite3.vcxproj
tcl.vcxproj
tk.vcxproj
unicodedata.vcxproj
venvlauncher.vcxproj
venvwlauncher.vcxproj
winsound.vcxproj
xxlimited_35.vcxproj
xxlimited.vcxproj
zlib-ng.vcxproj

10 files in directory that didn't have unused /GL warning

_ssl.vcxproj
openssl.vcxproj
python_uwp.vcxproj
python.vcxproj
pythonw_uwp.vcxproj
pythonw.vcxproj
tcl.vcxproj
tk.vcxproj
xxlimited_35.vcxproj
xxlimited.vcxproj

CPython versions tested on:

3.14

Operating systems tested on:

Windows

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions