You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Building the math module fails on FreeBSD: sinpi, cospi and tanpi are not declared in math.h #154136
Building main on FreeBSD (tested 15.1-RELEASE) fails since gh-150534:
./Modules/mathmodule.c:566:24: error: call to undeclared function 'sinpi'; ISO C99 and later do not support implicit function declarations [-Werror,-Wimplicit-function-declaration]
FreeBSD's libm exports cospi, sinpi and tanpi, but math.h declares them only for C23. CPython compiles with -std=c11 and defines _POSIX_C_SOURCE/_XOPEN_SOURCE, which reduces header visibility to C11. The link-only AC_CHECK_FUNCS test still finds the symbols and defines HAVE_SINPI etc., so compiling Modules/mathmodule.c fails. Linux is unaffected because glibc's _GNU_SOURCE implies _ISOC23_SOURCE.
The fix is to define _ISOC23_SOURCE, the feature-test macro both FreeBSD and glibc honor: the declarations become visible and the native libm implementations are actually used (FreeBSD's tanpi(0.25) returns exactly 1.0).
Activity
gh-154136: Define _ISOC23_SOURCE to fix building the math module on F…