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

[PATCH 5/7] Don't use empty structure initializers.

From
FFFlorian Forster <octo@verplant.org>
Date
Jun 18, 2006, 15:18 UTC
Message-ID
<11506438893544-git-send-email-octo@verplant.org>
In-Reply-To
<11506438893167-git-send-email-octo@verplant.org>

Empty initializers for structures are not allowed in ANSI C99. This patch removes such an initializer from `builtin-read-tree.c'. Since the struct was static (and is therefore implicitely initialized to zero anyway) it wasn't actually needed.

Signed-off-by: Florian Forster <octo@verplant.org>
---
 builtin-read-tree.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
91df4330d35f1f1670dd04af0a14f1ca84a72b2b
diff --git a/builtin-read-tree.c b/builtin-read-tree.c
index bb50fbd..fdd6706 100644
--- a/builtin-read-tree.c
+++ b/builtin-read-tree.c
@@ -30,8 +30,7 @@ static int merge_size = 0;
 
 static struct object_list *trees = NULL;
 
-static struct cache_entry df_conflict_entry = {
-};
+static struct cache_entry df_conflict_entry;
 
 struct tree_entry_list {
 	struct tree_entry_list *next;
-- 
1.3.3
Previous: Florian Forster
Message 3 of 3 in “Don't instantiate structures with FAMs.”
  1. 3/7 Don't instantiate structures with FAMs.Florian Forster, Jun 18, 2006
  2. 4/7 Cast pointers to `void *' when used in a format.Florian Forster, Jun 18, 2006
  3. 5/7 Don't use empty structure initializers.Florian Forster, Jun 18, 2006

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.