<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body><div>How about the getOption() function getting a boolean parameter specifying whether to allow "inherited" options, with the default being true?<br></div>
<div> </div>
<div>getOption("unix.stuff.moo.FooChecker", "MyOption", true) would then be equivalent to trying to all of these:<br></div>
<ul><li><div>unix.stuff.moo.FooChecker:MyOption<br></div>
</li><li><div>unix.stuff.moo:MyOption<br></div>
</li><li><div>unix.stuff:MyOption<br></div>
</li><li><div>unix:MyOption<br></div>
</li></ul><div>I think this behavior would be clear and straight-forward.<br></div>
<div> </div>
<div id="sig19426269"><div class="signature">---<br></div>
<div class="signature">Best regards,<br></div>
<div class="signature"> </div>
<div class="signature">Gábor 'ShdNx' Kozár<br></div>
<div class="signature"><a href="http://gaborkozar.me">http://gaborkozar.me</a><br></div>
<div class="signature"> </div>
</div>
<div> </div>
<div> </div>
<div>On Tue, Oct 14, 2014, at 00:27, Anna Zaks wrote:<br></div>
<blockquote type="cite"><div> </div>
<div><blockquote type="cite" class=""><div class="">On Oct 13, 2014, at 8:55 AM, Gabor Kozar <<a href="mailto:kozargabor@fastmail.fm" class="">kozargabor@fastmail.fm</a>> wrote:<br></div>
<div> </div>
<div class=""><div class=""><blockquote class=""><div class="">However, there will be no inheritance (i.e. the setting
'unix:Optimistic' is entirely distinct from the setting
‘unix.Malloc:Optimistic’).<br></div>
</blockquote><div class=""> </div>
<div class="">I think inheritance like that could be useful in some situations.<br></div>
</div>
</div>
</blockquote><div> </div>
<div>The main reason is that we currently do not have a need for it and allowing inheritance requires a design for it. For example, what happens when a package adds an option? How would the checkers access it? If we were to allow dynamically loaded checkers how would they inherit it? What happens if a checker overrides a package option?<br></div>
</div>
<div><div> </div>
<blockquote type="cite" class=""><div class=""><div class=""><div class="">I
would expect such options to be inherited, i.e. if I set
'unix:Optimistic', then I expect this to be visible everywhere in the
'unix' package. Why are disallowing this?<br></div>
<div class=""> </div>
</div>
</div>
</blockquote><div> </div>
<div>The package options will be visible to checkers; specifically, checkers could query the package options. For example, MallocChecker could call getOption(Optimistic, "unix") to check if the option has been set on the package. <br></div>
</div>
<div><div> </div>
<blockquote type="cite" class=""><div class=""><div class=""><div class="">(Sorry for the duplicate e-mail, sent the first from the wrong e-mail address.)<br></div>
<div class=""> </div>
<div class=""><div>---<br></div>
<div>Best regards,<br></div>
<div> </div>
<div>Gábor 'ShdNx' Kozár<br></div>
<div><a href="http://gaborkozar.me/" class="">http://gaborkozar.me</a><br></div>
</div>
<div class=""> </div>
<div class=""> </div>
<div class="">On Mon, Oct 13, 2014, at 15:59, Gabor Kozar wrote:<br></div>
<blockquote type="cite" class=""><blockquote class=""><div class="">However, there will be no inheritance (i.e. the setting 'unix:Optimistic' is entirely distinct from the setting ‘unix.Malloc:Optimistic’).<br></div>
</blockquote><div class=""> </div>
<div class="">I think inheritance like that could be useful in some situations. I would expect such options to be inherited, i.e. if I set 'unix:Optimistic', then I expect this to be visible everywhere in the 'unix' package. Why are you proposing to disallow this?<br></div>
<div class=""> </div>
<div class=""><div class="">---<br></div>
<div class="">Best regards,<br></div>
<div class=""> </div>
<div class="">Gábor 'ShdNx' Kozár<br></div>
<div class=""><a href="http://gaborkozar.me/" class="">http://gaborkozar.me</a><br></div>
<div class=""> </div>
</div>
<div class=""> </div>
<div class=""> </div>
<div class="">On Sat, Oct 11, 2014, at 01:17, Anna Zaks wrote:<br></div>
<blockquote type="cite" class=""><div class="">Background & Problem:<br></div>
<div class=""> </div>
<div class="">Clang has support for static analyzer options though "-analyzer-config”<br></div>
<div class="">front-end option, which is followed by the option name and value:<br></div>
<div class="">-analyzer-config <Option Name>=<Value><br></div>
<div class="">This option is also available through scan-build.<br></div>
<div class=""> </div>
<div class="">Currently, there is no way to pass command line options to specific<br></div>
<div class="">checkers. We work around it by creating new checker kinds (for example,<br></div>
<div class="">MallocPessimistic, MallocOptimistic).<br></div>
<div class=""> </div>
<div class="">Proposed Solution:<br></div>
<div class=""> </div>
<div class="">The proposal (partially authored and implemented by Aleksei Sidorin<br></div>
<div class=""><a href="http://reviews.llvm.org/D3967" class="">http://reviews.llvm.org/D3967</a>) is to extend "-analyzer-config" to support<br></div>
<div class="">checker-specific options as following:<br></div>
<div class="">-analyzer-config <Full Checker Name / Package Name>:<Option<br></div>
<div class="">Name>=<Value><br></div>
<div class=""> </div>
<div class="">To avoid ambiguities with regular options, we should enforce the<br></div>
<div class="">following:<br></div>
<div class="">1) <Option Name> should be an identifier<br></div>
<div class="">2) Checker names should be identifiers.<br></div>
<div class="">3) Package names should be identifiers joined with '.’.<br></div>
<div class="">4) <Full Checker Name> has the same form as package names.<br></div>
<div class=""> </div>
<div class="">Specifying options on a package will be allowed. However, there will be<br></div>
<div class="">no inheritance (i.e. the setting 'unix:Optimistic' is entirely distinct<br></div>
<div class="">from the setting ‘unix.Malloc:Optimistic’). Each checker will be able to<br></div>
<div class="">query options of its package when needed. For this, we propose changing<br></div>
<div class="">the getOption API to work with package and checker names as well as<br></div>
<div class="">CheckerBase.<br></div>
<div class=""> </div>
<div class="">Comments and suggestions are welcome!<br></div>
<div class="">Anna.<br></div>
<div class=""><u class="">_______________________________________________</u><br></div>
<div class="">cfe-dev mailing list<br></div>
<div class=""><a href="mailto:cfe-dev@cs.uiuc.edu" class="">cfe-dev@cs.uiuc.edu</a><br></div>
<div class=""><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" class="">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br></div>
</blockquote><div class=""> </div>
<div class=""><u class="">_______________________________________________</u><br></div>
<div class="">cfe-dev mailing list<br></div>
<div class=""><a href="mailto:cfe-dev@cs.uiuc.edu" class="">cfe-dev@cs.uiuc.edu</a><br></div>
<div class=""><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" class="">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br></div>
</blockquote><div class=""> </div>
</div>
<div>_______________________________________________<br></div>
<div>cfe-dev mailing list<br></div>
<div><a href="mailto:cfe-dev@cs.uiuc.edu" class="">cfe-dev@cs.uiuc.edu</a><br></div>
<div>http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev<br></div>
</div>
</blockquote></div>
<div> </div>
</blockquote><div> </div>
</body>
</html>