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

Re: [PATCH] Fix Solaris compiler warnings

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 16, 2007, 09:14 UTC
Message-ID
<7vve82zh5g.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20071116074850.GA3400@steel.home>
Alex Riesen <raa.lkml@gmail.com> writes:
Show 21 quoted lines
> Junio C Hamano, Fri, Nov 16, 2007 00:16:25 +0100:
>> Alex Riesen <raa.lkml@gmail.com> writes:
>> 
>> > Guido Ostkamp, Thu, Nov 15, 2007 23:19:11 +0100:
>> ...
>> >>     CC builtin-apply.o
>> >> "builtin-apply.c", line 686: warning: statement not reached
>> >>     CC utf8.o
>> >> "utf8.c", line 287: warning: statement not reached
>> >>     CC xdiff/xdiffi.o
>> >> "xdiff/xdiffi.c", line 261: warning: statement not reached
>> >
>> > All these are wrong. That's a fantastically broken piece of compiler
>> 
>> I've looked at builtin-apply and utf8 cases but these returns
>> are after an endless loop whose exit paths always return
>> directly, so these return statements are in fact never reached.
>> ...
>
> Hmm... Guido, I owe you an appology. Still, consider this patch
> instead (it does not fix the return in xdiff/xdiffi.c though):

If you are referring to the "xdiff/xdiffi.c:line 261" one (which I did not say if I looked at it or not), I think there is nothing to fix there, either. In front of itt is a big fat loop controlled with:

	for (ec = 1;; ec++) {
		...
	}

and only exits from there are returns. Two "break" appear but they are breaking out of nested inner loops and would not escape this outermost loop.

Previous: Alex RiesenNext: Guido Ostkamp
Message 5 of 10 in “Fix Solaris compiler warnings”
  1. Fix Solaris compiler warningsGuido Ostkamp, Nov 15, 2007
  2. Alex RiesenNov 15, 2007
  3. Junio C HamanoNov 15, 2007
  4. Alex RiesenNov 16, 2007
  5. Junio C HamanoNov 16, 2007
  6. Guido OstkampNov 16, 2007
  7. Rewrite some function exit paths to avoid "unreachable code" trapsAlex Riesen, Nov 17, 2007
  8. Robin RosenbergNov 17, 2007
  9. Alex RiesenNov 17, 2007
  10. Robin RosenbergNov 17, 2007

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.