Skip to content

Commit 1e278fc

Browse files
committed
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
1 parent 4d9ee66 commit 1e278fc

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

Makefile.pre.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -823,10 +823,10 @@ $(BUILDPYTHON): Programs/python.o $(LINK_PYTHON_DEPS) python_exe.o
823823
$(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -municode -o $@ Programs/python.o $(LINK_PYTHON_OBJS) $(LIBS) $(MODLIBS) $(SYSLIBS) python_exe.o
824824

825825
$(BUILDVENVLAUNCHER): $(BUILDPYTHON) venvlauncher.o $(srcdir)/PC/launcher.c
826-
$(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
826+
$(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
827827

828828
$(BUILDVENVWLAUNCHER): $(BUILDPYTHONW) venvwlauncher.o $(srcdir)/PC/launcher.c
829-
$(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
829+
$(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
830830

831831
platform: $(PYTHON_FOR_BUILD_DEPS) pybuilddir.txt
832832
$(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print("%s-%d.%d" % (get_platform(), *sys.version_info[:2]))' >platform

configure.ac

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2496,6 +2496,14 @@ case $GCC in
24962496
yes)
24972497
CFLAGS_NODIST="$CFLAGS_NODIST -std=c11"
24982498

2499+
# GCC 14 and later error out with incompatible-pointer-types
2500+
# this only occues on mingw
2501+
case $host in
2502+
*-*-mingw*)
2503+
CFLAGS_NODIST="$CFLAGS_NODIST -Wno-error=incompatible-pointer-types"
2504+
;;
2505+
esac
2506+
24992507
PY_CHECK_CC_WARNING([enable], [extra], [if we can add -Wextra])
25002508
AS_VAR_IF([ac_cv_enable_extra_warning], [yes],
25012509
[CFLAGS_NODIST="$CFLAGS_NODIST -Wextra"])

0 commit comments

Comments
 (0)