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

[PATCH 09/14] merge-recursive.c: Initialise variable to suppress msvc warning

From
Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Date
Dec 4, 2010, 19:08 UTC
Message-ID
<4CFA91A2.9090409@ramsay1.demon.co.uk>

The msvc compiler thinks a variable could be used while uninitialised and issues the following warning:

    ...\git\merge-recursive.c(1599) : warning C4700: uninitialized local \
        variable 'mrtree' used

In order to suppress the warning we simply initialise the mrtree pointer variable to NULL.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
---
 merge-recursive.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/merge-recursive.c b/merge-recursive.c
index 16c2dbe..d5423ad 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -1596,7 +1596,7 @@ int merge_recursive(struct merge_options *o,
 {
 	struct commit_list *iter;
 	struct commit *merged_common_ancestors;
-	struct tree *mrtree = mrtree;
+	struct tree *mrtree = NULL;
 	int clean;
 
 	if (show(o, 4)) {
-- 
1.7.3
Message 1 of 1 in “merge-recursive.c: Initialise variable to suppress msvc warning”
  1. 09/14 merge-recursive.c: Initialise variable to suppress msvc warningRamsay Jones, Dec 4, 2010

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.