# PATCH: diff-cache.c:51: `return' with a value, in function returning void

3 messages from 2005-05-03 to 2005-05-03. Participants: Alex Riesen, Junio C Hamano.
Thread: https://gitlist.dev/t/463

## Alex Riesen, 2005-05-03 19:56

Subject: PATCH: diff-cache.c:51: `return' with a value, in function returning void
Message-ID: <20050503195601.GA4165@steel.home>
URL: https://gitlist.dev/e/20050503195601.GA4165%40steel.home

```
gcc -g -O2 -Wall  '-DSHA1_HEADER=<openssl/sha.h>' -o git-diff-cache diff-cache.c libgit.a -lz -lssl
diff-cache.c: In function `show_new_file':
diff-cache.c:51: warning: `return' with a value, in function returning void


--- cogito/diff-cache.c	2005-05-03 21:50:42.000000000 +0200
+++ cogito/diff-cache.c	2005-05-03 21:52:00.000000000 +0200
@@ -48,7 +48,6 @@ static void show_new_file(struct cache_e
 		return;
 
 	show_file("+", new, sha1, mode);
-	return 0;
 }
 
 static int show_modified(struct cache_entry *old, struct cache_entry *new)


```

## Junio C Hamano, 2005-05-03 21:33

Subject: Re: PATCH: diff-cache.c:51: `return' with a value, in function returning void
Message-ID: <7vmzrct2ot.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vmzrct2ot.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <20050503195601.GA4165@steel.home>

```
>>>>> "AR" == Alex Riesen <fork0@users.sourceforge.net> writes:

AR> gcc -g -O2 -Wall  '-DSHA1_HEADER=<openssl/sha.h>' -o git-diff-cache diff-cache.c libgit.a -lz -lssl
AR> diff-cache.c: In function `show_new_file':
AR> diff-cache.c:51: warning: `return' with a value, in function returning void

This one was fixed in the Linus tree long time ago.


```

## Alex Riesen, 2005-05-03 21:44

Subject: Re: PATCH: diff-cache.c:51: `return' with a value, in function returning void
Message-ID: <20050503214434.GA31958@steel.home>
URL: https://gitlist.dev/e/20050503214434.GA31958%40steel.home
In-Reply-To: <7vmzrct2ot.fsf@assigned-by-dhcp.cox.net>

```
Junio C Hamano, Tue, May 03, 2005 23:33:22 +0200:
> >>>>> "AR" == Alex Riesen <fork0@users.sourceforge.net> writes:
> 
> AR> gcc -g -O2 -Wall  '-DSHA1_HEADER=<openssl/sha.h>' -o git-diff-cache diff-cache.c libgit.a -lz -lssl
> AR> diff-cache.c: In function `show_new_file':
> AR> diff-cache.c:51: warning: `return' with a value, in function returning void
> 
> This one was fixed in the Linus tree long time ago.
> 

Oh, sorry: it was cogito today.


```
