Files
MINGW-packages/mingw-w64-python3.12/0115-gcc-make-incompatible-pointer-types-as-warning.patch
2024-09-10 08:53:36 +02:00

49 lines
2.7 KiB
Diff

From d97008f0b0808f6d1df0d0b7985dd2492bc70de4 Mon Sep 17 00:00:00 2001
From: Naveen M K <naveen521kk@gmail.com>
Date: Thu, 11 Jul 2024 13:58:20 +0530
Subject: [PATCH 115/N] gcc: make `incompatible-pointer-types` as warning
gcc 14 changed `incompatible-pointer-types` from warning to error
for now, make it as warning to avoid build failure
---
Makefile.pre.in | 4 ++--
configure.ac | 8 ++++++++
2 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/Makefile.pre.in b/Makefile.pre.in
index a13dc45..eec14cd 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -827,10 +827,10 @@ $(BUILDPYTHON): Programs/python.o $(LINK_PYTHON_DEPS) python_exe.o
$(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -municode -o $@ Programs/python.o $(LINK_PYTHON_OBJS) $(LIBS) $(MODLIBS) $(SYSLIBS) python_exe.o
$(BUILDVENVLAUNCHER): $(BUILDPYTHON) venvlauncher.o $(srcdir)/PC/launcher.c
- $(LINKCC) -D_CONSOLE -DVENV_REDIRECT -DPYTHON_EXECUTABLE_WITH_VERSION="L\"python$(LDVERSION)$(EXE)\"" -municode -static -static-libgcc -static-libstdc++ venvlauncher.o $(srcdir)/PC/launcher.c -o $@ -lversion
+ $(LINKCC) -D_CONSOLE -DVENV_REDIRECT -DPYTHON_EXECUTABLE_WITH_VERSION="L\"python$(LDVERSION)$(EXE)\"" -Wno-error=incompatible-pointer-types -municode -static -static-libgcc -static-libstdc++ venvlauncher.o $(srcdir)/PC/launcher.c -o $@ -lversion
$(BUILDVENVWLAUNCHER): $(BUILDPYTHONW) venvwlauncher.o $(srcdir)/PC/launcher.c
- $(LINKCC) -D_WINDOWS -DVENV_REDIRECT -DPYTHON_EXECUTABLE_WITH_VERSION="L\"pythonw$(LDVERSION)$(EXE)\"" -mwindows -municode -static -static-libgcc -static-libstdc++ venvwlauncher.o $(srcdir)/PC/launcher.c -o $@ -lversion
+ $(LINKCC) -D_WINDOWS -DVENV_REDIRECT -DPYTHON_EXECUTABLE_WITH_VERSION="L\"pythonw$(LDVERSION)$(EXE)\"" -Wno-error=incompatible-pointer-types -mwindows -municode -static -static-libgcc -static-libstdc++ venvwlauncher.o $(srcdir)/PC/launcher.c -o $@ -lversion
platform: $(PYTHON_FOR_BUILD_DEPS) pybuilddir.txt
$(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print("%s-%d.%d" % (get_platform(), *sys.version_info[:2]))' >platform
diff --git a/configure.ac b/configure.ac
index c4ececd..9c8fa1e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2504,6 +2504,14 @@ case $GCC in
yes)
CFLAGS_NODIST="$CFLAGS_NODIST -std=c11"
+ # GCC 14 and later error out with incompatible-pointer-types
+ # this only occues on mingw
+ case $host in
+ *-*-mingw*)
+ CFLAGS_NODIST="$CFLAGS_NODIST -Wno-error=incompatible-pointer-types"
+ ;;
+ esac
+
PY_CHECK_CC_WARNING([enable], [extra], [if we can add -Wextra])
AS_VAR_IF([ac_cv_enable_extra_warning], [yes],
[CFLAGS_NODIST="$CFLAGS_NODIST -Wextra"])