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

void return diff-cache.c

From
DWDan Weber <dan@mirrorlynx.com>
Date
Apr 28, 2005, 01:22 UTC
Message-ID
<Pine.LNX.4.62.0504272121230.9460@mirrorlynx.com>

While compiling cogito, I got a compiler warning about returning -1 in a void function. Attached is the patch.

Dan
Can not return -1 in a void function, but we can return there

--- commit b34f64adc18ae04fe299257871a102307683d36b tree 29f7b7d146b689f7a724e94f8daddceab219942d parent 1e02ed14dc046dc47aafe93ef36587c99670a498 author Dan Weber <dan@mirrorlynx.com> 1114651105 -0400 committer Dan Weber <dan@mirrorlynx.com> 1114651105 -0400

Index: diff-cache.c
===================================================================
--- 3144235bc3b64961e133bc8e3a6b9c756923907a/diff-cache.c  (mode:100644 sha1:30804d2775d4a65a7892ae2bf0b35715812e939b)
+++ 29f7b7d146b689f7a724e94f8daddceab219942d/diff-cache.c  (mode:100644 sha1:e365f713fa28526f8a883f03a0173755987eadea)
@@ -45,7 +45,7 @@
 
 	/* New file in the index: it might actually be different in the working copy */
 	if (get_stat_data(new, &sha1, &mode) < 0)
-		return -1;
+		return;
 
 	show_file("+", new, sha1, mode);
 }
Message 1 of 1 in “void return diff-cache.c”
  1. Dan WeberApr 28, 2005

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.