From 34bc26abdde2b89d2bcb22be0baeb98f141435b6 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Sat, 8 Aug 2026 12:50:15 -1000 Subject: Pin the sources to gnu17 --- source/cgit.mk | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source/cgit.mk') diff --git a/source/cgit.mk b/source/cgit.mk index 3234148..e0a3312 100644 --- a/source/cgit.mk +++ b/source/cgit.mk @@ -35,8 +35,19 @@ $(CGIT_BUILD)/VERSION: force-version -include $(CGIT_BUILD)/VERSION .PHONY: force-version +# The language the cgit sources are written in. Both GCC and Clang default to +# this today, so pinning it changes nothing now and stops the meaning of the +# sources drifting when a compiler moves its default on (GCC 15 defaults to +# gnu23). The GNU dialect rather than plain c17 because git's headers use GNU +# extensions, and because dlsym cannot be used through a conforming cast. +# +# Only the cgit objects are held to this. Git keeps whatever its own build +# decides, which on some platforms is a different standard again. +CGIT_STD ?= gnu17 + # CGIT_CFLAGS is tracked separately so that changing it does not force a # rebuild of Git itself. +CGIT_CFLAGS += -std=$(CGIT_STD) CGIT_CFLAGS += -DCGIT_CONFIG='"$(CGIT_CONFIG)"' CGIT_CFLAGS += -DCGIT_SCRIPT_NAME='"$(CGIT_SCRIPT_NAME)"' CGIT_CFLAGS += -DCGIT_CACHE_ROOT='"$(CACHE_ROOT)"' -- cgit v2.8.0