Skip to content

Commit 1da0cd6

Browse files
committed
unix: ensure some warnings are not errors
Clang 16 makes `implicit-function-declarations` and `incompatible-function-pointer-types` errors by default instead of warnings. This commit adds the compiler flag to ensure they remain warnings and not errors.
1 parent 0df7052 commit 1da0cd6

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

cpython-unix/build-tix.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ chmod +x configure
2323

2424
CFLAGS="${EXTRA_TARGET_CFLAGS} -fPIC -DUSE_INTERP_RESULT"
2525

26+
# Error by default in Clang 16.
27+
if [ "${CC}" = "clang" ]; then
28+
CFLAGS="${CFLAGS} -Wno-error=implicit-function-declaration -Wno-error=incompatible-function-pointer-types"
29+
fi
30+
2631
if [ "${PYBUILD_PLATFORM}" = "macos" ]; then
2732
CFLAGS="${CFLAGS} -I${TOOLS_PATH}/deps/include"
2833
EXTRA_CONFIGURE_FLAGS="--without-x"

cpython-unix/build-uuid.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ export PATH=${TOOLS_PATH}/${TOOLCHAIN}/bin:${TOOLS_PATH}/host/bin:$PATH
1212
tar -xf libuuid-${UUID_VERSION}.tar.gz
1313
pushd libuuid-${UUID_VERSION}
1414

15-
CFLAGS="${EXTRA_TARGET_CFLAGS} -fPIC" CPPFLAGS="${EXTRA_TARGET_CFLAGS} -fPIC" LDFLAGS="${EXTRA_TARGET_LDFLAGS}" ./configure \
15+
CFLAGS="${EXTRA_TARGET_CFLAGS} -fPIC"
16+
17+
# Error by default in Clang 16.
18+
CFLAGS="${CFLAGS} -Wno-error=implicit-function-declaration"
19+
20+
CFLAGS="${CFLAGS}" CPPFLAGS="${EXTRA_TARGET_CFLAGS} -fPIC" LDFLAGS="${EXTRA_TARGET_LDFLAGS}" ./configure \
1621
--build=${BUILD_TRIPLE} \
1722
--host=${TARGET_TRIPLE} \
1823
--prefix=/tools/deps \

0 commit comments

Comments
 (0)