This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFC: Improving GCC8 default option settings


On Wed, Sep 13, 2017 at 9:43 AM, Janne Blomqvist
<blomqvist.janne@gmail.com> wrote:
> 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.

-- 
Kevin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]