On Wed, Sep 13, 2017 at 9:43 AM, Janne Blomqvist <blomqvist.ja...@gmail.com> wrote: > On Tue, Sep 12, 2017 at 4:57 PM, Wilco Dijkstra <wilco.dijks...@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