git/list[1] front-page[2] threads[3] people[4] search[5] about
 

va_copy is not available on all systems.

From
Johannes Sixt <j.sixt@eudaptics.com>
Date
Aug 20, 2007, 13:16 UTC
Message-ID
<46C99448.2AB33DFF@eudaptics.com>
This is just too ugly to be included...

die_nicely() uses the variable argument list twice. The recent fix for this in 7e5dcea8311 uses va_copy. However, on older systems this function is not available. This fix assumes that those systems that do have the function actually implement it as macro, and we use it to remove the entire nicely() functionality.

Since va_copy() must be provided by the compiler, we don't have a
reasonable chance to provide a working definition in git_compat_util.h.
---
 fast-import.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/fast-import.c b/fast-import.c
index 2d5224c..edc76a4 100644
--- a/fast-import.c
+++ b/fast-import.c
@@ -349,6 +349,7 @@ static unsigned int cmd_save = 100;
 static uintmax_t next_mark;
 static struct dbuf new_data;
 
+#ifdef va_copy
 static void write_branch_report(FILE *rpt, struct branch *b)
 {
 	fprintf(rpt, "%s:\n", b->name);
@@ -456,6 +457,7 @@ static NORETURN void die_nicely(const char *err, va_list params)
 	va_end(x_params);
 	exit(128);
 }
+#endif
 
 static void alloc_objects(unsigned int cnt)
 {
@@ -2381,7 +2383,9 @@ int main(int argc, const char **argv)
 
 	prepare_packed_git();
 	start_packfile();
+#ifdef va_copy
 	set_die_routine(die_nicely);
+#endif
 	for (;;) {
 		read_next_command();
 		if (command_buf.eof)
-- 
1.5.3.rc5.15.g8ddb
Next: Michael Poole
Message 1 of 6 in “va_copy is not available on all systems.”
  1. Johannes SixtAug 20, 2007
  2. Michael PooleAug 20, 2007
  3. Alex RiesenAug 20, 2007
  4. Shawn O. PearceAug 21, 2007
  5. Junio C HamanoAug 21, 2007
  6. Alex RiesenAug 21, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.