[New-bugs-announce] [issue43767] Compiler arning about 'Yield' macro redefinition on Windows

Guido van Rossum report at bugs.python.org
Wed Apr 7 14:33:30 EDT 2021

New submission from Guido van Rossum <guido at python.org>:

When building from scratch on Windows I get this warning:

c:\program files (x86)\windows kits\10\include\10.0.17763.0\um\winbase.h(103): warning C4005: 'Yield': macro redefinition [C:\Users\gvanrossum\cpython\PCbuild\pythoncore.vcxproj]

I know there is at least one place where we try to prevent this warning, e.g. in Include/internal/pycore_ast.h there's this line:

#undef Yield   /* undefine macro conflicting with <winbase.h> */

But apparently this isn't enough, or the error comes from a different file, or some rearrangement of header files made this #undef ineffective.

Victor, is it possible that your https://github.com/python/cpython/pull/24933 reintroduced this warning?

Steve, what can I do to diagnose this better? (The warning doesn't tell me where winbase.h was included.)

components: Windows
messages: 390462
nosy: gvanrossum, paul.moore, steve.dower, tim.golden, vstinner, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: Compiler arning about 'Yield' macro redefinition on Windows
type: compile error
versions: Python 3.10

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list