[cfe-dev] Configuration files

Serge Pavlov via cfe-dev cfe-dev at lists.llvm.org
Wed Sep 28 05:57:08 PDT 2016

2016-09-28 16:22 GMT+07:00 Joerg Sonnenberger via cfe-dev <
cfe-dev at lists.llvm.org>:

> On Wed, Sep 28, 2016 at 01:39:59PM +0700, Serge Pavlov via cfe-dev wrote:
> > > Sorry for being late to the discussion,
> > >
> > > I think automatic user defaults are a bad idea: Right now when you
> invoke
> > > clang without any additional options you know that you are in a well
> known
> > > state. Build systems and projects rely on this having unknown compiler
> > > options active because the user put them into his configuration file
> is a
> > > recipe for disaster IMO! The example below "-std=c++14 -fcxx-exception"
> > > already illustrates a situation in which settings are used that can
> break
> > > the compilation of many projects!
> > >
> > >
> > In fact invocation of clang without additional argument does not provide
> a
> > well known state. Actual state is represented by options passed from
> clang
> > driver to clang compiler, but these options depend on used OS, CPU. In
> > theory a system upgrade could cause compilation change. Hardly bare
> driver
> > arguments can represent compilation options.
> This is frankly FUD. While a compiler update can sometimes introduce new
> default warnings (or add them to -Wall), those are governed by pretty
> strict rules. The far majority of the options, especially the per-OS
> per-CPU configuration changes very rarely and few of those changes are
> user-visible in the sense that they break valid input.
You are right, the mapping from driver options to compiler ones is
relatively stable now.
My statement was inspired by ICC option -xHost, which selects options
for the host processor. In any case the set of options passed from driver
to compiler is
more robust characteristic and it differs from user supplied options

> > Default config file is just a way to influence the magic of option
> > calculation made by driver. Config files can be used by clang based SDK
> > suppliers to customize clang without need to modify compiler sources. If
> > end user plays with default config files, he must know what he does.
> But that's the point. Users often don't know or forget. There are long
> rants to be found by Google of people forcing -OMG -ffast-math for
> everything because they don't understand the implications. I strongly
> hope that any vendor shipping a customized default config puts a strong
> "Do not change this file without fully understanding what you are doing"
> comment in it. The important part is that others are the ones that pay
> the price.
 Absolutely agree!

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160928/478da8c9/attachment.html>

More information about the cfe-dev mailing list