From 6b855d562aa16b1e36ef7270b0dcfdb27398bd24 Mon Sep 17 00:00:00 2001 From: mrdudz Date: Sun, 10 Dec 2023 23:18:55 +0100 Subject: [PATCH] use -std=gnu17 for the references, so the test bench will not break with GCC 14. see #2277 --- test/ref/Makefile | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/test/ref/Makefile b/test/ref/Makefile index abd3e9bc0..9538fdee7 100644 --- a/test/ref/Makefile +++ b/test/ref/Makefile @@ -39,8 +39,18 @@ OPTIONS = g O Os Osi Osir Osr Oi Oir Or ISEQUAL = ..$S..$Stestwrk$Sisequal$(EXE) +# NOTE: the current test bench may include K&R style C, C89 style C, C99 - and +# even things from later standards. Technically C99 removed certain C89 +# constructs - However, so far GCC would still compile them and issue a +# warning (instead of an error). Now, GCC 14 will be more strict about this, +# and by default make those things an error instead. We use -std=gnu17 here +# so we can still build the references with a modern compiler, and don't +# have to deal with special-casing individual tests that use constructs +# from those old standards. Should this become a problem in the future, we +# will have to change that, and create said special cases here. +# see discussion in https://github.com/cc65/cc65/issues/2277 CC = gcc -CFLAGS = -O2 -Wall -W -Wextra -funsigned-char -fwrapv -fno-strict-overflow +CFLAGS = -std=gnu17 -O2 -Wall -W -Wextra -funsigned-char -fwrapv -fno-strict-overflow .PHONY: all clean