From fc41f7917531693680b5baf71ffe38c47333fe84 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Mon, 6 Apr 2026 15:55:33 +0200 Subject: Make the project build with Microsoft's broken C compiler. MSVC is not fully C11-compliant, even when compiling with /std:c11. Some changes were needed to make the codebase compatible. Notably, the notation a[static N] and a[n] for function parameters of array type is not supported, so that had to be hidden behind a macro. Atomic types are also an experimental feature, apparently, but at least they work with the correct compiler flag. One thing that MSVC does well, however, is warning on integer conversions on /W4 level. I am not sure if Clang and GCC have something similar, so I took this chance to fix some of these. --- test/062_transform_move/transform_move_tests.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test/062_transform_move') diff --git a/test/062_transform_move/transform_move_tests.c b/test/062_transform_move/transform_move_tests.c index 218c6a1..a9beb60 100644 --- a/test/062_transform_move/transform_move_tests.c +++ b/test/062_transform_move/transform_move_tests.c @@ -5,10 +5,10 @@ cube_t applytrans(cube_t, const char *); uint8_t transform_move(uint8_t, uint8_t); int64_t readmoves(const char *, size_t n, size_t m, - size_t *, size_t *, uint8_t [n], uint8_t [m]); + size_t *, size_t *, uint8_t *, uint8_t *); oriented_cube_t move_extended(oriented_cube_t, uint8_t); oriented_cube_t applymoves(oriented_cube_t, const char *); -uint8_t readtrans(const char[static NISSY_SIZE_TRANSFORMATION]); +uint8_t readtrans(const char[SIZE(NISSY_SIZE_TRANSFORMATION)]); void run(void) { char movestr[STRLENMAX], transtr[STRLENMAX], cubestr[STRLENMAX]; -- cgit v1.3