Re: [PATCH] Makefile: detect compiler and enable more warnings in DEVELOPER=1

2018-03-19 Thread Jeff King
On Sun, Mar 18, 2018 at 04:55:25PM +0100, Duy Nguyen wrote: > On Sun, Mar 18, 2018 at 9:18 AM, Nguyễn Thái Ngọc Duy > wrote: > > +ifneq ($(or $(filter gcc6,$(COMPILER_FEATURES)),$(filter > > clang4,$(COMPILER_FEATURES))),) > > +CFLAGS += -Wextra > > Another thing we can add here is -Og instead

Re: [PATCH] Makefile: detect compiler and enable more warnings in DEVELOPER=1

2018-03-19 Thread Duy Nguyen
On Sun, Mar 18, 2018 at 7:56 PM, Ramsay Jones wrote: > > > On 18/03/18 15:55, Duy Nguyen wrote: >> On Sun, Mar 18, 2018 at 9:18 AM, Nguyễn Thái Ngọc Duy >> wrote: >>> +ifneq ($(or $(filter gcc6,$(COMPILER_FEATURES)),$(filter >>> clang4,$(COMPILER_FEATURES))),) >>> +CFLAGS += -Wextra >> >> Anoth

Re: [PATCH] Makefile: detect compiler and enable more warnings in DEVELOPER=1

2018-03-18 Thread Ramsay Jones
On 18/03/18 15:55, Duy Nguyen wrote: > On Sun, Mar 18, 2018 at 9:18 AM, Nguyễn Thái Ngọc Duy > wrote: >> +ifneq ($(or $(filter gcc6,$(COMPILER_FEATURES)),$(filter >> clang4,$(COMPILER_FEATURES))),) >> +CFLAGS += -Wextra > > Another thing we can add here is -Og instead of standard -O2 (or -O0

Re: [PATCH] Makefile: detect compiler and enable more warnings in DEVELOPER=1

2018-03-18 Thread Duy Nguyen
On Sun, Mar 18, 2018 at 9:18 AM, Nguyễn Thái Ngọc Duy wrote: > +ifneq ($(or $(filter gcc6,$(COMPILER_FEATURES)),$(filter > clang4,$(COMPILER_FEATURES))),) > +CFLAGS += -Wextra Another thing we can add here is -Og instead of standard -O2 (or -O0 in my build), which is supported since gcc 4.8. cla

Re: [PATCH] Makefile: detect compiler and enable more warnings in DEVELOPER=1

2018-03-18 Thread Duy Nguyen
On Sun, Mar 18, 2018 at 10:26 AM, Jeff King wrote: > On Sun, Mar 18, 2018 at 09:18:34AM +0100, Nguyễn Thái Ngọc Duy wrote: > >> The set of extra warnings we enable when DEVELOPER has to be >> conservative because we can't assume any compiler version the >> developer may use. Detect the compiler ve

Re: [PATCH] Makefile: detect compiler and enable more warnings in DEVELOPER=1

2018-03-18 Thread Eric Sunshine
On Sun, Mar 18, 2018 at 5:28 AM, Jeff King wrote: > On Sun, Mar 18, 2018 at 05:06:07AM -0400, Eric Sunshine wrote: >> On MacOS, "cc -v" output is: >> --- >8 --- >> Apple LLVM version 9.0.0 (clang-900.0.39.2) >> Target: x86_64-apple-darwin16.7.0 >> Thread model: posix >> InstalledDir: ... >> --- >8

Re: [PATCH] Makefile: detect compiler and enable more warnings in DEVELOPER=1

2018-03-18 Thread Jeff King
On Sun, Mar 18, 2018 at 05:06:07AM -0400, Eric Sunshine wrote: > On MacOS, "cc -v" output is: > > --- >8 --- > Apple LLVM version 9.0.0 (clang-900.0.39.2) > Target: x86_64-apple-darwin16.7.0 > Thread model: posix > InstalledDir: ... > --- >8 --- Is that really way ahead of the clang releases (wh

Re: [PATCH] Makefile: detect compiler and enable more warnings in DEVELOPER=1

2018-03-18 Thread Jeff King
On Sun, Mar 18, 2018 at 09:18:34AM +0100, Nguyễn Thái Ngọc Duy wrote: > The set of extra warnings we enable when DEVELOPER has to be > conservative because we can't assume any compiler version the > developer may use. Detect the compiler version so we know when it's > safe to enable -Wextra and ma

Re: [PATCH] Makefile: detect compiler and enable more warnings in DEVELOPER=1

2018-03-18 Thread Eric Sunshine
On Sun, Mar 18, 2018 at 5:17 AM, Duy Nguyen wrote: > On Sun, Mar 18, 2018 at 10:06 AM, Eric Sunshine > wrote: >> On MacOS, "cc -v" output is: >> --- >8 --- >> Apple LLVM version 9.0.0 (clang-900.0.39.2) >> Target: x86_64-apple-darwin16.7.0 >> Thread model: posix >> InstalledDir: ... >> --- >8 --

Re: [PATCH] Makefile: detect compiler and enable more warnings in DEVELOPER=1

2018-03-18 Thread Jeff King
On Sun, Mar 18, 2018 at 10:17:41AM +0100, Duy Nguyen wrote: > On Sun, Mar 18, 2018 at 10:06 AM, Eric Sunshine > wrote: > > On Sun, Mar 18, 2018 at 09:18:34AM +0100, Nguyễn Thái Ngọc Duy wrote: > >> The set of extra warnings we enable when DEVELOPER has to be > >> conservative because we can't as

Re: [PATCH] Makefile: detect compiler and enable more warnings in DEVELOPER=1

2018-03-18 Thread Duy Nguyen
On Sun, Mar 18, 2018 at 10:06 AM, Eric Sunshine wrote: > On Sun, Mar 18, 2018 at 09:18:34AM +0100, Nguyễn Thái Ngọc Duy wrote: >> The set of extra warnings we enable when DEVELOPER has to be >> conservative because we can't assume any compiler version the >> developer may use. Detect the compiler

Re: [PATCH] Makefile: detect compiler and enable more warnings in DEVELOPER=1

2018-03-18 Thread Eric Sunshine
On Sun, Mar 18, 2018 at 09:18:34AM +0100, Nguyễn Thái Ngọc Duy wrote: > The set of extra warnings we enable when DEVELOPER has to be > conservative because we can't assume any compiler version the > developer may use. Detect the compiler version so we know when it's > safe to enable -Wextra and may

[PATCH] Makefile: detect compiler and enable more warnings in DEVELOPER=1

2018-03-18 Thread Nguyễn Thái Ngọc Duy
The set of extra warnings we enable when DEVELOPER has to be conservative because we can't assume any compiler version the developer may use. Detect the compiler version so we know when it's safe to enable -Wextra and maybe more. Helped-by: Jeff King Signed-off-by: Nguyễn Thái Ngọc Duy --- -dum