From 5e9eda8c1e23ac1d54d7634899abd42b762c229e Mon Sep 17 00:00:00 2001 From: Manuel Frischknecht Date: Sat, 16 May 2026 16:26:20 +0200 Subject: [PATCH] pcem: fix build due to C23 checks `pcem` does not build with C23 settings because of an underspecified argument list for a function pointer: ``` [...] disc.c: In function 'disc_stop': disc.c:286:17: error: too many arguments to function 'drives[drive].stop'; expected 0, have 1 286 | drives[drive].stop(drive); | ^~~~~~ ~~~~~ In file included from disc.c:4: disc.h:9:16: note: declared here 9 | void (*stop)(); | ^~~~ make[1]: *** [Makefile:2455: pcem-disc.o] Error 1 make[1]: Leaving directory '/build/source/src' make: *** [Makefile:373: all-recursive] Error 1 ``` Switching to `-std=gcc17` fixes this for now. I suspect future releases of `pcem` will fix this at some point, but this hasn't happened yet [^1]. [^1]: https://github.com/sarah-walker-pcem/pcem/blob/d674c4088e04a5fdc74e452c4d5284fa8920726d/includes/private/disc/disc.h#L10 --- pkgs/by-name/pc/pcem/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/pc/pcem/package.nix b/pkgs/by-name/pc/pcem/package.nix index 5d4980d1eaf5..e0bd9dd80dc7 100644 --- a/pkgs/by-name/pc/pcem/package.nix +++ b/pkgs/by-name/pc/pcem/package.nix @@ -46,7 +46,7 @@ stdenv.mkDerivation (finalAttrs: { ++ lib.optional withALSA "--enable-alsa"; # Fix GCC 14 build - env.NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration -Wno-error=incompatible-pointer-types"; + env.NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration -Wno-error=incompatible-pointer-types -std=gnu17"; meta = { description = "Emulator for IBM PC computers and clones";