This is the mail archive of the
mailing list for the GCC project.
Re: RFC: Improving GCC8 default option settings
- From: Kevin André <hyperquantum at gmail dot com>
- To: Janne Blomqvist <blomqvist dot janne at gmail dot com>
- Cc: Wilco Dijkstra <Wilco dot Dijkstra at arm dot com>, "gcc at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>, nd <nd at arm dot com>
- Date: Wed, 13 Sep 2017 15:42:22 +0200
- Subject: Re: RFC: Improving GCC8 default option settings
- Authentication-results: sourceware.org; auth=none
- References: <HE1PR0801MB2058CFEE6A9C43380337A83F83690@HE1PR0801MB2058.eurprd08.prod.outlook.com> <CAO9iq9EyVs=4yBRk3kpCoeACVr9fzH3XDdGm75+CnPbd4f6S7w@mail.gmail.com>
On Wed, Sep 13, 2017 at 9:43 AM, Janne Blomqvist
> On Tue, Sep 12, 2017 at 4:57 PM, Wilco Dijkstra <Wilco.Dijkstra@arm.com> wrote:
>> These are just a few ideas to start. What do people think? I'd welcome discussion
>> and other proposals for similar improvements.
> What about the default behavior if no options are given? I think a
> more reasonable default would be something roughly like
> -O2 -Wall
> or if debuggability is considered more important that speed & size, maybe
> -Og -g -Wall
Enabling (some) warnings by default seems reasonable to me. Not sure
about the rest though.
This is something people can't seem to agree on. Some like warnings by
default, some like optimizations by default. Some are against warnings
by default, arguing that people like distro-builders have no need for
warnings (for example). Some are against optimizations by default,
because it would make compilation slower when they just want to check
if some piece of code compiles successfully or not (for example).
I think the only way to decide what options to enable by default is to
first decide who your target audience is going to be. Who do you
expect to run gcc with no options specified? If you ask me, that will
mostly be students or beginners. Those who are experienced are more
likely to use an automated build system where they specify build
options only once and then forget about it. An unexperienced person
would need warnings and debug info by default, and maybe a few simple
optimizations that do not interfere with debugging. There can only be
one set of default options, and which one you pick will depend on who
your target audience is. You cannot please everyone.