Re: [PATCH] mailinfo: resolve -Wstring-plus-int warning

2014-09-23 Thread Jeff King
On Mon, Sep 22, 2014 at 05:10:08PM -0400, Eric Sunshine wrote: On Mon, Sep 22, 2014 at 1:41 PM, Junio C Hamano gits...@pobox.com wrote: Eric Sunshine sunsh...@sunshineco.com writes: The just-released Apple Xcode 6.0.1 has -Wstring-plus-int enabled by default which complains about pointer

Re: [PATCH] mailinfo: resolve -Wstring-plus-int warning

2014-09-23 Thread Junio C Hamano
On Mon, Sep 22, 2014 at 11:04 PM, Jeff King p...@peff.net wrote: I don't mind silencing this one warning (even though I find it a little ridiculous). I'm slightly concerned that more brain-damage may be coming our way, but we can deal with that if it ever does. Like Junio, I prefer keeping

Re: [PATCH] mailinfo: resolve -Wstring-plus-int warning

2014-09-23 Thread Jeff King
On Mon, Sep 22, 2014 at 11:26:14PM -0700, Junio C Hamano wrote: On Mon, Sep 22, 2014 at 11:04 PM, Jeff King p...@peff.net wrote: I don't mind silencing this one warning (even though I find it a little ridiculous). I'm slightly concerned that more brain-damage may be coming our way, but

Re: [PATCH] mailinfo: resolve -Wstring-plus-int warning

2014-09-23 Thread Eric Sunshine
On Tue, Sep 23, 2014 at 2:04 AM, Jeff King p...@peff.net wrote: On Mon, Sep 22, 2014 at 05:10:08PM -0400, Eric Sunshine wrote: On Mon, Sep 22, 2014 at 1:41 PM, Junio C Hamano gits...@pobox.com wrote: Eric Sunshine sunsh...@sunshineco.com writes: The just-released Apple Xcode 6.0.1 has

Re: [PATCH] mailinfo: resolve -Wstring-plus-int warning

2014-09-23 Thread Eric Sunshine
On Tue, Sep 23, 2014 at 2:26 AM, Junio C Hamano gits...@pobox.com wrote: On Mon, Sep 22, 2014 at 11:04 PM, Jeff King p...@peff.net wrote: I don't mind silencing this one warning (even though I find it a little ridiculous). I'm slightly concerned that more brain-damage may be coming our way,

Re: [PATCH] mailinfo: resolve -Wstring-plus-int warning

2014-09-23 Thread Eric Sunshine
On Tue, Sep 23, 2014 at 3:51 AM, Jeff King p...@peff.net wrote: On Mon, Sep 22, 2014 at 11:26:14PM -0700, Junio C Hamano wrote: On Mon, Sep 22, 2014 at 11:04 PM, Jeff King p...@peff.net wrote: I don't mind silencing this one warning (even though I find it a little ridiculous). I'm

Re: [PATCH] mailinfo: resolve -Wstring-plus-int warning

2014-09-23 Thread Jeff King
On Tue, Sep 23, 2014 at 03:52:21AM -0400, Eric Sunshine wrote: That is my reading from the warning text, too, but I have to wonder: wouldn't that mean they should be warning about pointer + pointer, not pointer + int? 'pointer + pointer' is not legal C, is it? What would the result

Re: [PATCH] mailinfo: resolve -Wstring-plus-int warning

2014-09-22 Thread Junio C Hamano
Eric Sunshine sunsh...@sunshineco.com writes: The just-released Apple Xcode 6.0.1 has -Wstring-plus-int enabled by default which complains about pointer arithmetic applied to a string literal: builtin/mailinfo.c:303:24: warning: adding 'long' to a string does not append to the

Re: [PATCH] mailinfo: resolve -Wstring-plus-int warning

2014-09-22 Thread Junio C Hamano
Eric Sunshine sunsh...@sunshineco.com writes: however, the solution in this patch allows us drop a couple strlen()s in favor of sizeof()s. It is actually not a very good justification when you know you care about the length of the string. A decent compiler ought to know the length of a

Re: [PATCH] mailinfo: resolve -Wstring-plus-int warning

2014-09-22 Thread Eric Sunshine
On Mon, Sep 22, 2014 at 1:41 PM, Junio C Hamano gits...@pobox.com wrote: Eric Sunshine sunsh...@sunshineco.com writes: The just-released Apple Xcode 6.0.1 has -Wstring-plus-int enabled by default which complains about pointer arithmetic applied to a string literal:

Re: [PATCH] mailinfo: resolve -Wstring-plus-int warning

2014-09-22 Thread Eric Sunshine
On Mon, Sep 22, 2014 at 4:50 PM, Junio C Hamano gits...@pobox.com wrote: Eric Sunshine sunsh...@sunshineco.com writes: however, the solution in this patch allows us drop a couple strlen()s in favor of sizeof()s. It is actually not a very good justification when you know you care about the

[PATCH] mailinfo: resolve -Wstring-plus-int warning

2014-09-21 Thread Eric Sunshine
The just-released Apple Xcode 6.0.1 has -Wstring-plus-int enabled by default which complains about pointer arithmetic applied to a string literal: builtin/mailinfo.c:303:24: warning: adding 'long' to a string does not append to the string return !memcmp(SAMPLE + (cp -