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/133_coordata_drfinnoe/coorddata_drfinnoe.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/133_coordata_drfinnoe') diff --git a/test/133_coordata_drfinnoe/coorddata_drfinnoe.c b/test/133_coordata_drfinnoe/coorddata_drfinnoe.c index 11ae9f7..7d19361 100644 --- a/test/133_coordata_drfinnoe/coorddata_drfinnoe.c +++ b/test/133_coordata_drfinnoe/coorddata_drfinnoe.c @@ -10,7 +10,7 @@ size_t coordinate_drfinnoe_gendata(unsigned char *); void run(void) { bool found; - uint64_t t; + uint8_t t; char str[STRLENMAX]; unsigned char *data; size_t size; @@ -32,8 +32,8 @@ void run(void) { goto cleanup; } - for (t = 0, found = false; t < 48; t++) { - if (!((UINT64_C(1) << t) & TGROUP)) + for (t = 0, found = false, coord2 = UINT64_MAX; t < 48; t++) { + if (!((UINT64_C(1) << (uint64_t)t) & TGROUP)) continue; coord2 = coordinate_drfinnoe_coord(transform(cube, t), data); -- cgit v1.3