Skip to content

Commit

Permalink
unix: ensure some warnings are not errors
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
indygreg committed Apr 8, 2023
1 parent 0df7052 commit 1da0cd6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
5 changes: 5 additions & 0 deletions cpython-unix/build-tix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ chmod +x configure

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

# Error by default in Clang 16.
if [ "${CC}" = "clang" ]; then
CFLAGS="${CFLAGS} -Wno-error=implicit-function-declaration -Wno-error=incompatible-function-pointer-types"
fi

if [ "${PYBUILD_PLATFORM}" = "macos" ]; then
CFLAGS="${CFLAGS} -I${TOOLS_PATH}/deps/include"
EXTRA_CONFIGURE_FLAGS="--without-x"
Expand Down
7 changes: 6 additions & 1 deletion cpython-unix/build-uuid.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ export PATH=${TOOLS_PATH}/${TOOLCHAIN}/bin:${TOOLS_PATH}/host/bin:$PATH
tar -xf libuuid-${UUID_VERSION}.tar.gz
pushd libuuid-${UUID_VERSION}

CFLAGS="${EXTRA_TARGET_CFLAGS} -fPIC" CPPFLAGS="${EXTRA_TARGET_CFLAGS} -fPIC" LDFLAGS="${EXTRA_TARGET_LDFLAGS}" ./configure \
CFLAGS="${EXTRA_TARGET_CFLAGS} -fPIC"

# Error by default in Clang 16.
CFLAGS="${CFLAGS} -Wno-error=implicit-function-declaration"

CFLAGS="${CFLAGS}" CPPFLAGS="${EXTRA_TARGET_CFLAGS} -fPIC" LDFLAGS="${EXTRA_TARGET_LDFLAGS}" ./configure \
--build=${BUILD_TRIPLE} \
--host=${TARGET_TRIPLE} \
--prefix=/tools/deps \
Expand Down

0 comments on commit 1da0cd6

Please sign in to comment.