Re: Fixing the warning about warning(""); was: Re: [PATCH] difftool.c: mark a file-local symbol with static

2017-01-26 Thread Junio C Hamano
Jeff King writes: > On Thu, Jan 26, 2017 at 07:39:55AM +0100, Johannes Sixt wrote: > >> Am 25.01.2017 um 23:01 schrieb Jeff King: >> > +#pragma GCC diagnostic ignored "-Wformat-zero-length" >> >> Last time I used #pragma GCC in a cross-platform project, it triggered an >> "unknown pragma" warnin

Re: Fixing the warning about warning(""); was: Re: [PATCH] difftool.c: mark a file-local symbol with static

2017-01-26 Thread Johannes Schindelin
Hi Peff, On Thu, 26 Jan 2017, Jeff King wrote: > On Thu, Jan 26, 2017 at 12:16:10PM +0100, Johannes Schindelin wrote: > > > We could switch the DEVELOPER option on by default, when gcc or clang > > is used at least. Otherwise the DEVELOPER option (which I like very > > much) would not be able to

Re: Fixing the warning about warning(""); was: Re: [PATCH] difftool.c: mark a file-local symbol with static

2017-01-26 Thread Jeff King
On Thu, Jan 26, 2017 at 12:16:10PM +0100, Johannes Schindelin wrote: > We could switch the DEVELOPER option on by default, when gcc or clang is > used at least. Otherwise the DEVELOPER option (which I like very much) > would not be able to live up to its full potential. I'm not sure that is a goo

Re: Fixing the warning about warning(""); was: Re: [PATCH] difftool.c: mark a file-local symbol with static

2017-01-26 Thread Jeff King
On Thu, Jan 26, 2017 at 12:37:46PM +0100, Johannes Schindelin wrote: > > Am 25.01.2017 um 23:01 schrieb Jeff King: > > > +#pragma GCC diagnostic ignored "-Wformat-zero-length" > > > > Last time I used #pragma GCC in a cross-platform project, it triggered > > an "unknown pragma" warning for MSVC.

Re: Fixing the warning about warning(""); was: Re: [PATCH] difftool.c: mark a file-local symbol with static

2017-01-26 Thread Jeff King
On Thu, Jan 26, 2017 at 07:39:55AM +0100, Johannes Sixt wrote: > Am 25.01.2017 um 23:01 schrieb Jeff King: > > +#pragma GCC diagnostic ignored "-Wformat-zero-length" > > Last time I used #pragma GCC in a cross-platform project, it triggered an > "unknown pragma" warning for MSVC. (It was the C++

Re: Fixing the warning about warning(""); was: Re: [PATCH] difftool.c: mark a file-local symbol with static

2017-01-26 Thread Johannes Schindelin
Hi Hannes, On Thu, 26 Jan 2017, Johannes Sixt wrote: > Am 25.01.2017 um 23:01 schrieb Jeff King: > > +#pragma GCC diagnostic ignored "-Wformat-zero-length" > > Last time I used #pragma GCC in a cross-platform project, it triggered > an "unknown pragma" warning for MSVC. It is starting to become

Re: Fixing the warning about warning(""); was: Re: [PATCH] difftool.c: mark a file-local symbol with static

2017-01-26 Thread Johannes Schindelin
Hi Peff, On Wed, 25 Jan 2017, Jeff King wrote: > On Wed, Jan 25, 2017 at 11:36:50AM +0100, Johannes Schindelin wrote: > > > > Gross, but at least it's self documenting. :) > > > > > > I guess a less horrible version of that is: > > > > > > static inline warning_blank_line(void) > > > { > >

Re: Fixing the warning about warning(""); was: Re: [PATCH] difftool.c: mark a file-local symbol with static

2017-01-25 Thread Johannes Sixt
Am 25.01.2017 um 23:01 schrieb Jeff King: +#pragma GCC diagnostic ignored "-Wformat-zero-length" Last time I used #pragma GCC in a cross-platform project, it triggered an "unknown pragma" warning for MSVC. (It was the C++ compiler, I don't know if the C compiler would also warn.) It would hav

Re: Fixing the warning about warning(""); was: Re: [PATCH] difftool.c: mark a file-local symbol with static

2017-01-25 Thread Jeff King
On Wed, Jan 25, 2017 at 01:28:27PM -0800, Junio C Hamano wrote: > Jeff King writes: > > > The only advantage is that it is self-documenting, so somebody does not > > come through later and convert ("%s", "") back to (""). We could also > > write a comment. But I am happy if we simply catch it in

Re: Fixing the warning about warning(""); was: Re: [PATCH] difftool.c: mark a file-local symbol with static

2017-01-25 Thread Junio C Hamano
Jeff King writes: > The only advantage is that it is self-documenting, so somebody does not > come through later and convert ("%s", "") back to (""). We could also > write a comment. But I am happy if we simply catch it in review (or > preferably the person is clueful enough to read the output of

Re: Fixing the warning about warning(""); was: Re: [PATCH] difftool.c: mark a file-local symbol with static

2017-01-25 Thread Jeff King
On Wed, Jan 25, 2017 at 11:36:50AM +0100, Johannes Schindelin wrote: > > Gross, but at least it's self documenting. :) > > > > I guess a less horrible version of that is: > > > > static inline warning_blank_line(void) > > { > > warning("%s", ""); > > } > > > > We'd potentially need a

Fixing the warning about warning(""); was: Re: [PATCH] difftool.c: mark a file-local symbol with static

2017-01-25 Thread Johannes Schindelin
Hi Peff, On Tue, 24 Jan 2017, Jeff King wrote: > On Tue, Jan 24, 2017 at 01:52:13PM -0800, Junio C Hamano wrote: > > > > I dunno. As ugly as the "%s" thing is in the source, at least it > > > doesn't change the output. Not that an extra space is the end of the > > > world, but it seems like it's

Re: [PATCH] difftool.c: mark a file-local symbol with static

2017-01-24 Thread Jeff King
On Tue, Jan 24, 2017 at 01:52:13PM -0800, Junio C Hamano wrote: > > I dunno. As ugly as the "%s" thing is in the source, at least it doesn't > > change the output. Not that an extra space is the end of the world, but > > it seems like it's letting the problem escape from the source code. > > > > D

Re: [PATCH] difftool.c: mark a file-local symbol with static

2017-01-24 Thread Junio C Hamano
Jeff King writes: >> > As ugly as warning("%s", "") is, I think it may be the thing that annoys >> > the smallest number of people. >> > >> > -Peff >> >> How about using warning(" ") instead? >> >> For difftool.c specifically, the following is a fine solution, >> and doesn't require that we ch

Re: [PATCH] difftool.c: mark a file-local symbol with static

2017-01-24 Thread Jeff King
mn Sat, Jan 21, 2017 at 09:26:08PM -0800, David Aguilar wrote: > > > An obvious second > > > best option would be to drop -Wall from the "everybody" CFLAGS and > > > move it to DEVELOPER_CFLAGS instead. > > > > Yeah, though that doesn't help the example above. > > > > As ugly as warning("%s", ""

Re: [PATCH] difftool.c: mark a file-local symbol with static

2017-01-21 Thread David Aguilar
On Thu, Dec 01, 2016 at 01:50:57PM -0500, Jeff King wrote: > On Thu, Dec 01, 2016 at 10:20:50AM -0800, Junio C Hamano wrote: > > I also still think that any_printf_like_function("%s", "") looks > > silly. I know that we've already started moving in that direction > > and we stopped at a place we d

Re: [PATCH] difftool.c: mark a file-local symbol with static

2016-12-01 Thread Jeff King
On Thu, Dec 01, 2016 at 10:20:50AM -0800, Junio C Hamano wrote: > Jeff King writes: > > > I don't have a preference on which direction we go, but yes, right now > > we are in an awkward middle ground. We should do one of: > > > > 1. Drop -Wno-format-zero-length from DEVELOPER_CFLAGS and make s

Re: [PATCH] difftool.c: mark a file-local symbol with static

2016-12-01 Thread Junio C Hamano
Jeff King writes: > I don't have a preference on which direction we go, but yes, right now > we are in an awkward middle ground. We should do one of: > > 1. Drop -Wno-format-zero-length from DEVELOPER_CFLAGS and make sure > future patches to do not violate it. > > 2. Declare warning("")

Re: [PATCH] difftool.c: mark a file-local symbol with static

2016-11-30 Thread Jeff King
On Thu, Dec 01, 2016 at 01:18:35AM +, Ramsay Jones wrote: > >> I forgot, we ended up reversing course later and silencing them: > >> > >> http://public-inbox.org/git/20140505052117.gc6...@sigill.intra.peff.net/ > >> > >> By the rationale of that conversation, we should be doing: > >> > >>

Re: [PATCH] difftool.c: mark a file-local symbol with static

2016-11-30 Thread Ramsay Jones
On 30/11/16 23:46, Junio C Hamano wrote: > Jeff King writes: > >> I forgot, we ended up reversing course later and silencing them: >> >> http://public-inbox.org/git/20140505052117.gc6...@sigill.intra.peff.net/ >> >> By the rationale of that conversation, we should be doing: >> >> warning("%

Re: [PATCH] difftool.c: mark a file-local symbol with static

2016-11-30 Thread Junio C Hamano
Jeff King writes: > I forgot, we ended up reversing course later and silencing them: > > http://public-inbox.org/git/20140505052117.gc6...@sigill.intra.peff.net/ > > By the rationale of that conversation, we should be doing: > > warning("%s", ""); > > here. I forgot too. Thanks for digging

Re: [PATCH] difftool.c: mark a file-local symbol with static

2016-11-30 Thread Jeff King
On Wed, Nov 30, 2016 at 10:37:40PM +, Ramsay Jones wrote: > > Anyway. Those are all options, but I don't think there is any problem > > with sticking with warning("") for now. It is not the first part of the > > code that tickles the format-zero-length warning. > > Hmm, well I have been build

Re: [PATCH] difftool.c: mark a file-local symbol with static

2016-11-30 Thread Ramsay Jones
On 30/11/16 21:25, Jeff King wrote: > On Wed, Nov 30, 2016 at 12:40:25PM -0800, Junio C Hamano wrote: > >> Ramsay Jones writes: >> >>> [I have fixed my config.mak file now, so I don't see the warning >>> anymore! Having -Wno-format-zero-length in DEVELOPER_CFLAGS, or >>> not, is a separate matt

Re: [PATCH] difftool.c: mark a file-local symbol with static

2016-11-30 Thread Jeff King
On Wed, Nov 30, 2016 at 12:40:25PM -0800, Junio C Hamano wrote: > Ramsay Jones writes: > > > [I have fixed my config.mak file now, so I don't see the warning > > anymore! Having -Wno-format-zero-length in DEVELOPER_CFLAGS, or > > not, is a separate matter.] > > I suspect that 658df95a4a ("add D

Re: [PATCH] difftool.c: mark a file-local symbol with static

2016-11-30 Thread Junio C Hamano
Ramsay Jones writes: > [I have fixed my config.mak file now, so I don't see the warning > anymore! Having -Wno-format-zero-length in DEVELOPER_CFLAGS, or > not, is a separate matter.] I suspect that 658df95a4a ("add DEVELOPER makefile knob to check for acknowledged warnings", 2016-02-25) took it

Re: [PATCH] difftool.c: mark a file-local symbol with static

2016-11-30 Thread Ramsay Jones
On 30/11/16 11:07, Johannes Schindelin wrote: > Hi Ramsay, > > On Tue, 29 Nov 2016, Ramsay Jones wrote: >> Also, due to a problem in my config.mak file on Linux (a commented >> out line that had a line continuation '\', gr!), gcc issued a >> warning, thus: >> >> builtin/difftool.c: In func

Re: [PATCH] difftool.c: mark a file-local symbol with static

2016-11-30 Thread Johannes Schindelin
Hi Ramsay, On Tue, 29 Nov 2016, Ramsay Jones wrote: > If you need to re-roll your 'js/difftool-builtin' branch, could > you please squash this into the relevant patch. Fixed. Thanks! > Also, due to a problem in my config.mak file on Linux (a commented > out line that had a line continuation '\'

[PATCH] difftool.c: mark a file-local symbol with static

2016-11-29 Thread Ramsay Jones
Signed-off-by: Ramsay Jones --- Hi Johannes, If you need to re-roll your 'js/difftool-builtin' branch, could you please squash this into the relevant patch. Thanks! Also, due to a problem in my config.mak file on Linux (a commented out line that had a line continuation '\', gr!), gcc issu