Re: [PATCH 3/3] Makefile: use -Wdeclaration-after-statement if supported

2012-12-22 Thread Junio C Hamano
Adam Spiers writes: > Fair enough, but let's not allow perfect to become the enemy of good. That is why I would prefer a solution without any false positive while allowing false negatives, i.e. not force everybody to use these flags without giving a way to turn them off. You could perhaps sell

Re: [PATCH 3/3] Makefile: use -Wdeclaration-after-statement if supported

2012-12-22 Thread Adam Spiers
On Mon, Dec 17, 2012 at 4:18 AM, Junio C Hamano wrote: > Adam Spiers writes: > >> OK; I expect these issues with the implementation are all >> surmountable. I did not necessarily expect this to be the final >> implementation anyhow, as indicated by my comments below the divider >> line. However

Re: [PATCH 3/3] Makefile: use -Wdeclaration-after-statement if supported

2012-12-16 Thread Junio C Hamano
Adam Spiers writes: > OK; I expect these issues with the implementation are all > surmountable. I did not necessarily expect this to be the final > implementation anyhow, as indicated by my comments below the divider > line. However it's not clear to me what you think about the idea in > princi

Re: [PATCH 3/3] Makefile: use -Wdeclaration-after-statement if supported

2012-12-16 Thread Adam Spiers
On Sun, Dec 16, 2012 at 05:52:05PM -0800, Junio C Hamano wrote: > Adam Spiers writes: > > > If we adopt this approach,... > > diff --git a/Makefile b/Makefile > > index a49d1db..aae70d4 100644 > > --- a/Makefile > > +++ b/Makefile > > @@ -331,8 +331,13 @@ endif > > # CFLAGS and LDFLAGS are for t

Re: [PATCH 3/3] Makefile: use -Wdeclaration-after-statement if supported

2012-12-16 Thread Junio C Hamano
Adam Spiers writes: > If we adopt this approach,... > diff --git a/Makefile b/Makefile > index a49d1db..aae70d4 100644 > --- a/Makefile > +++ b/Makefile > @@ -331,8 +331,13 @@ endif > # CFLAGS and LDFLAGS are for the users to override from the command line. > > CFLAGS = -g -O2 -Wall > +GCC_DE

[PATCH 3/3] Makefile: use -Wdeclaration-after-statement if supported

2012-12-16 Thread Adam Spiers
CodingGuidelines requests that code should be nice to older C compilers. Since modern gcc can warn on code written using newer dialects such as C99, it makes sense to take advantage of this by auto-detecting this capability and enabling it when found. Signed-off-by: Adam Spiers --- If we adopt th