<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Sep 19, 2016, at 1:06 AM, Serge Pavlov via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" class="">cfe-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="">Hi all,</div><div class=""><br class=""></div><div class="">I would like to propose implementing configuration files in clang. The idea is to read some set of options prior to the options specified in a command line in every tool invocation. These options are taken from a file which is searched either in predefined place or its location is specified by environmental variable.</div><div class=""><br class=""></div><div class="">Few words about particular problem this facility can solve. Clang issues many warnings, some refer to potential errors, some merely attract attention to code that can cause problems in some circumstances but otherwise is pretty innocent. For example, warning -Wundefined-var-template is issued for template usages, which nor cannot be instantiated implicitly neither are mentioned in explicit instantiation declarations. Such usage is not an error or bad style, but the warning may be helpful for a user in a complex case, such as described in PR24425. For other users this warning may be annoying and they would prefer to turn it off by default (see discussion in <a href="http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20160808/167354.html" class="">http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20160808/167354.html</a>). Different categories of users like to have different set of warnings enabled by default.</div><div class=""><br class=""></div><div class="">If configuration files were supported by clang, a user can put -Wno-undefined-var-template to such file and this would have the same effect as if the unwanted warning were turned off by default. No changes to build scripts would be required.</div></div></div></blockquote><div><br class=""></div><div>As a side note, you can already have this behavior of override the compiler options without changing the build settings using the environment variable CCC_OVERRIDE_OPTIONS.</div><div><br class=""></div><div>— </div><div>Mehdi</div><div><br class=""></div><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class="">Configuration files are supported by the Intel Compiler (<a href="https://software.intel.com/en-us/node/522780" class="">https://software.intel.com/en-us/node/522780</a>) and similar behavior is proposed to be implemented by clang.</div><div class=""><br class=""></div><div class="">By default the configuration file is searched in the same directory where tool executable resides. In the case of clang the file would be 'clang.cfg', for other tool named 'foo'- 'foo.cfg'. User can specify any location for this file if he sets up environmental variable 'CLANGCFG' (or 'FOOCFG'). The variable should contain path to configuration file. If the configuration file does not exist, it is silently ignored. Content of configuration file is treated as a part of command line of each tool invocation preceding any arguments specified in command line.</div><div class=""><br class=""></div><div class="">Does implementation of this facility makes sense?</div><div class=""><br class=""></div><div class=""><div class="gmail_signature">Thanks,<br class="">--Serge<br class=""></div></div>
</div>
_______________________________________________<br class="">cfe-dev mailing list<br class=""><a href="mailto:cfe-dev@lists.llvm.org" class="">cfe-dev@lists.llvm.org</a><br class="">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev<br class=""></div></blockquote></div><br class=""></body></html>