[New-bugs-announce] [issue39961] warning: this use of "defined" may not be portable (Mac OS)

Clem Wang report at bugs.python.org
Fri Mar 13 19:09:18 EDT 2020


New submission from Clem Wang <clem at clem.com>:

pyenv install 3.8.2
results in:

BUILD FAILED (OS X 10.15.3 using python-build 20180424)

Inspect or clean up the working tree at /var/folders/jy/10md97xn3mz_x_b42l1r2r8c0000gp/T/python-build.20200313154805.37448
Results logged to /var/folders/jy/10md97xn3mz_x_b42l1r2r8c0000gp/T/python-build.20200313154805.37448.log

Last 10 log lines:
  331 | #if !_PTHREAD_SWIFT_IMPORTER_NULLABILITY_COMPAT
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread.h:331:6: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread.h:540:6: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
  540 | #if !_PTHREAD_SWIFT_IMPORTER_NULLABILITY_COMPAT
      |      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread.h:540:6: warning: this use of "defined" may not be portable [-Wexpansion-to-defined]
cc1: some warnings being treated as errors
make: *** [Objects/floatobject.o] Error 1
make: *** Waiting for unfinished jobs....


The real problem is on line 199 of
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/pthread.h

/* <rdar://problem/25944576> */
#define _PTHREAD_SWIFT_IMPORTER_NULLABILITY_COMPAT \
	defined(SWIFT_CLASS_EXTRA) && (!defined(SWIFT_SDK_OVERLAY_PTHREAD_EPOCH) || (SWIFT_SDK_OVERLAY_PTHREAD_EPOCH < 1))


I'm not sure if this is a problem for Apple to fix or whether the Python build needs to be more tolerant of warnings.

----------
components: macOS
messages: 364125
nosy: clem.wang, ned.deily, ronaldoussoren
priority: normal
severity: normal
status: open
title: warning: this use of "defined" may not be portable (Mac OS)
type: compile error
versions: Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39961>
_______________________________________


More information about the New-bugs-announce mailing list