root.h overrides the compiler's va_copy with an invalid assignment, breaking the build on x86_64
yodl/root/root.h:81-88 carries a fallback for platforms lacking va_copy:
/* va_copy is C99; try to deal with systems that lack it. */
#ifndef va_copy
# ifdef __va_copy
# define va_copy __va_copy
# else
# define va_copy(dest, src) do { dest = src; } while (0)
# endif
#endifroot.h does not include <stdarg.h> (its only include is <stddef.h> at
line 14), and it is included ahead of <stdarg.h> by its consumers —
yodl/string/string.h:10 includes ../root/root.h, and <stdarg.h> only
follows at line 12.
So when the guard is evaluated neither va_copy nor __va_copy is defined
yet, and the fallback replaces a perfectly good compiler-provided va_copy
with a plain assignment.
That assignment is invalid wherever va_list is an array type. On x86_64
(System V) va_list is __builtin_va_list, an array type, so
yodl/string/stringvformat.c:13 (va_copy(copy, list);) is a hard error:
stringvformat.c:13:5: error: array type 'va_list' (aka '__builtin_va_list') is not assignable
13 | va_copy(copy, list);
| ^ ~~~~
./../root/root.h:86:42: note: expanded from macro 'va_copy'
86 | # define va_copy(dest, src) do { dest = src; } while (0)
| ~~~~ ^
1 error generated.On arm64 Darwin va_list is a plain char *, which is assignable, so the
build succeeds there — which is why this shows up as an Intel-only failure.
Recent clang rejects it outright rather than warning.
Fix: include <stdarg.h> in root.h ahead of the guard, so the
compiler's own va_copy is visible and the fallback is correctly skipped:
--- a/yodl/root/root.h
+++ b/yodl/root/root.h
@@ -78,6 +78,8 @@
# define ATTRIBUTE_FORMAT_PRINTF(a,b)
#endif
+#include <stdarg.h>
+
/* va_copy is C99; try to deal with systems that lack it. */
#ifndef va_copy
# ifdef __va_copyVerified on the same code in 3.05.01 (identical va_copy block): with the
include added, ./build programs, ./build macros and ./build man all
complete rc=0 on x86_64 with stock flags; without it the build fails as above.
Tested on macOS 15.7.8 x86_64, Apple clang 17.0.0.
Downstream report: https://trac.macports.org/ticket/74329