Re: [PATCH] Makefile: detect compiler and enable more warnings in DEVELOPER=1
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Mar 19, 2018, 16:30 UTC
- Message-ID
- <CACsJy8D4QdjncLdX83Xo4g5e-ZbCBqMfN9qaybXx5R3xC9d1gA@mail.gmail.com>
- In-Reply-To
- <d30d131e-1cfe-fedb-4a45-7628615a7876@ramsayjones.plus.com>
On Sun, Mar 18, 2018 at 7:56 PM, Ramsay Jones <ramsay@ramsayjones.plus.com> wrote:
Show 18 quoted lines
>
>
> 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 <pclouds@gmail.com> 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. clang seems to support
>> it too (mapped to -O1 at least for clang5) but I don't know what
>> version added that flag.
>
> I've been doing a lot of compiling recently, using 10 'different'
> versions of clang and gcc ('different' if you count 64-bit and 32-bit
> compilers with the same version number as different!)
>
> However, I can tell you that clang version 3.4 and 3.8.0 don't
> support -Og, but clang version 5.0.1 does.Yeah. I checked clang git mirror and this -Og is in 4.x release branch (couldn't nail down exact release) so 5.x should be a safe bet.
-- Duy