Re: Git compile warnings (under mac/clang)

2015-01-23 Thread Junio C Hamano
Jeff King p...@peff.net writes: diff --git a/fsck.c b/fsck.c index 15cb8bd..8f8c82f 100644 --- a/fsck.c +++ b/fsck.c @@ -107,7 +107,7 @@ static int fsck_msg_severity(enum fsck_msg_id msg_id, { int severity; -if (options-msg_severity msg_id = 0 msg_id FSCK_MSG_MAX) +if

Re: Git compile warnings (under mac/clang)

2015-01-23 Thread Johannes Schindelin
Hi Peff, On 2015-01-23 19:37, Jeff King wrote: On Fri, Jan 23, 2015 at 10:07:18AM -0800, Junio C Hamano wrote: [...] one thing that puzzles me is that the current code looks like: if (options-msg_severity msg_id = 0 msg_id FSCK_MSG_MAX) severity =

Re: Git compile warnings (under mac/clang)

2015-01-23 Thread Johannes Schindelin
Hi Peff, On 2015-01-23 19:55, Jeff King wrote: On Fri, Jan 23, 2015 at 07:46:36PM +0100, Johannes Schindelin wrote: ? And then you can spell that first part as assert(), which I suspect (but did not test) may shut up clang's warnings. To be quite honest, I assumed that Git's source code

Re: Git compile warnings (under mac/clang)

2015-01-23 Thread Jeff King
On Fri, Jan 23, 2015 at 10:07:18AM -0800, Junio C Hamano wrote: diff --git a/fsck.c b/fsck.c index 15cb8bd..8f8c82f 100644 --- a/fsck.c +++ b/fsck.c @@ -107,7 +107,7 @@ static int fsck_msg_severity(enum fsck_msg_id msg_id, { int severity; - if (options-msg_severity

Re: Git compile warnings (under mac/clang)

2015-01-23 Thread Junio C Hamano
Jeff King p...@peff.net writes: But of all the options outlined, I think I'd much rather just see an assert() for something that should never happen, rather than mixing it into the logic. Surely. In that vein, one thing that puzzles me is that the current code looks like: if

Re: Git compile warnings (under mac/clang)

2015-01-23 Thread Jeff King
On Fri, Jan 23, 2015 at 07:46:36PM +0100, Johannes Schindelin wrote: ? And then you can spell that first part as assert(), which I suspect (but did not test) may shut up clang's warnings. To be quite honest, I assumed that Git's source code was assert()-free. But I was wrong! So I'll go

Re: Git compile warnings (under mac/clang)

2015-01-23 Thread Jeff King
On Fri, Jan 23, 2015 at 12:48:29PM +0100, Johannes Schindelin wrote: This is what I have currently in the way of attempting to fix it (I still believe that Clang is wrong to make this a warning, and causes more trouble than it solves): I agree. It is something we as the programmers cannot

Re: Git compile warnings (under mac/clang)

2015-01-23 Thread Johannes Schindelin
Hi Peff, On 2015-01-22 23:01, Jeff King wrote: On Thu, Jan 22, 2015 at 10:20:01PM +0100, Johannes Schindelin wrote: On 2015-01-22 20:59, Stefan Beller wrote: cc Johannes Schindelin johannes.schinde...@gmx.de who is working in the fsck at the moment On Thu, Jan 22, 2015 at 11:43 AM,

Re: Git compile warnings (under mac/clang)

2015-01-23 Thread Jeff King
On Fri, Jan 23, 2015 at 01:38:17PM +0100, Johannes Schindelin wrote: Unless we are willing to drop the = 0 check completely. I think it is valid to do so regardless of the compiler's representation decision due to the numbering rules I mentioned above. It kind-of serves as a cross-check

Re: Git compile warnings (under mac/clang)

2015-01-23 Thread Johannes Schindelin
Hi Peff, On 2015-01-23 13:23, Jeff King wrote: On Fri, Jan 23, 2015 at 12:48:29PM +0100, Johannes Schindelin wrote: Pointed out by Michael Blume. Jeff King provided the pointer to a commit fixing the same issue elsewhere in the Git source code. It may be useful to reference the

Re: Git compile warnings (under mac/clang)

2015-01-22 Thread Jeff King
On Thu, Jan 22, 2015 at 10:20:01PM +0100, Johannes Schindelin wrote: On 2015-01-22 20:59, Stefan Beller wrote: cc Johannes Schindelin johannes.schinde...@gmx.de who is working in the fsck at the moment On Thu, Jan 22, 2015 at 11:43 AM, Michael Blume blume.m...@gmail.com wrote:

Git compile warnings (under mac/clang)

2015-01-22 Thread Michael Blume
These are probably minor, I only bring them up because Git's build is generally so quiet that it might be worth squashing these too. CC fsck.o fsck.c:110:38: warning: comparison of unsigned enum expression = 0 is always true [-Wtautological-compare] if (options-msg_severity msg_id =

Re: Git compile warnings (under mac/clang)

2015-01-22 Thread Stefan Beller
cc Johannes Schindelin johannes.schinde...@gmx.de who is working in the fsck at the moment cc Peter Wu pe...@lekensteyn.nl who worked on builtin/remote.c a few weeks ago I just compiled origin/pu to test and also found a problem (doesn't happen in origin/master): http.c: In function

Re: Git compile warnings (under mac/clang)

2015-01-22 Thread Peter Wu
On Thursday 22 January 2015 11:59:54 Stefan Beller wrote: cc Johannes Schindelin johannes.schinde...@gmx.de who is working in the fsck at the moment cc Peter Wu pe...@lekensteyn.nl who worked on builtin/remote.c a few weeks ago I just compiled origin/pu to test and also found a problem

Re: Git compile warnings (under mac/clang)

2015-01-22 Thread Johannes Schindelin
Hi Stefan, On 2015-01-22 20:59, Stefan Beller wrote: cc Johannes Schindelin johannes.schinde...@gmx.de who is working in the fsck at the moment On Thu, Jan 22, 2015 at 11:43 AM, Michael Blume blume.m...@gmail.com wrote: CC fsck.o fsck.c:110:38: warning: comparison of unsigned enum