From 8450156e98ee49484f3fadad791d5684f9576f8b Mon Sep 17 00:00:00 2001 From: eunhhu Date: Thu, 1 Oct 2026 18:19:14 +0100 Subject: Build with clang, and the core and store on macOS, again Apple clang 21 (an M3) and clang 19 refused what gcc let pass (research 029): - PURE_FIELD_REST was an enum of UINT32_MAX, past an int (C17): a macro. - a store's publish copied an entry rebuild left unset when the record was not found (the copy was never used): copied when it was made. - the log's image writer kept a count only Linux's sync_file_range uses. - ",{" + (row == from) read as adding an int to a string: said plainly. - the tests: mkdtemp, hidden by _POSIX_C_SOURCE on macOS, needs _DARWIN_C_SOURCE; a string split so that \x80 and a stay apart is bracketed; a count left over and a malloc measure only glibc has. The core's and the store's tests pass on the Mac. --- store/store-tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'store/store-tree.c') diff --git a/store/store-tree.c b/store/store-tree.c index ecdced6..3404edd 100644 --- a/store/store-tree.c +++ b/store/store-tree.c @@ -1202,7 +1202,7 @@ static PureResult publish(Session *session, Writer *writer, size_t count, const written = find(&session->tree, catalog, keys[i], &index, &found, ¤t, &stored) && rebuild(&session->tree, catalog, index * RECORD, found ? RECORD : 0, (PureSpan){record, RECORD}, &updated); - catalog = updated; + if (written) catalog = updated; } written = written && write_root(&session->tree, writer, &catalog, false) && flush(writer); /* Unpublished bytes stay in the tail; the next commit overwrites them. */ -- cgit v1.2.3