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

[PATCH] merge-file: fix build warning with gcc 4.8.5

From
Đoàn Trần Công Danh <congdanhqx@gmail.com>
Date
Jul 29, 2022, 09:05 UTC
Message-ID
<365e01e93dce582e9d926e83bdc6891310d22699.1659084832.git.congdanhqx@gmail.com>

mmfs is an array of struct, xmparamt_t's first field is a struct, mmfs's element and xmparamt_t's first field must be initialised with {0}.

Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
---
 This warning is available in master
 builtin/merge-file.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/builtin/merge-file.c b/builtin/merge-file.c
index c923bbf2ab..607c3d3f9e 100644
--- a/builtin/merge-file.c
+++ b/builtin/merge-file.c
@@ -26,9 +26,9 @@ static int label_cb(const struct option *opt, const char *arg, int unset)
 int cmd_merge_file(int argc, const char **argv, const char *prefix)
 {
 	const char *names[3] = { 0 };
-	mmfile_t mmfs[3] = { 0 };
+	mmfile_t mmfs[3] = { { 0 } };
 	mmbuffer_t result = { 0 };
-	xmparam_t xmp = { 0 };
+	xmparam_t xmp = { { 0 } };
 	int ret = 0, i = 0, to_stdout = 0;
 	int quiet = 0;
 	struct option options[] = {
-- 
2.37.1.560.gdfb9273964
Next: Junio C Hamano
Message 1 of 11 in “merge-file: fix build warning with gcc 4.8.5”
  1. merge-file: fix build warning with gcc 4.8.5Đoàn Trần Công Danh, Jul 29, 2022
  2. Junio C HamanoJul 29, 2022
  3. Jeff KingJul 29, 2022
  4. Jeff KingJul 29, 2022
  5. Eric SunshineJul 29, 2022
  6. Jeff KingJul 29, 2022
  7. Junio C HamanoJul 29, 2022
  8. Đoàn Trần Công DanhJul 30, 2022
  9. Jeff KingJul 30, 2022
  10. brian m. carlsonJul 30, 2022
  11. Jeff KingJul 30, 2022

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.