<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<div class="moz-cite-prefix">On 09/01/2014 17:52, Jordan Rose wrote:<br>
</div>
<blockquote
cite="mid:2598408C-98A8-4FCB-9C3E-0B7930737D5C@apple.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=windows-1252">
<br>
<div>
<div>On Jan 9, 2014, at 9:42 , Alp Toker <<a
moz-do-not-send="true" href="mailto:alp@nuanti.com">alp@nuanti.com</a>>
wrote:</div>
<br class="Apple-interchange-newline">
<blockquote type="cite">
<div style="font-style: normal; font-variant: normal;
font-weight: normal; letter-spacing: normal; line-height:
normal; orphans: auto; text-align: start; text-indent: 0px;
text-transform: none; white-space: normal; widows: auto;
word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br>
On 09/01/2014 17:30, Jordan Rose wrote:<br>
<blockquote type="cite"><br>
Would it help if the function were pre-declared in a
system header, and then just implemented or not
implemented in user code?<br>
</blockquote>
<br>
Hi Jordan,<br>
<br>
That's the current situation -- as long as sanitizer headers
are available and in use the part of the spec you
highlighted means it's acceptable.<br>
<br>
The problem arises when sanitizer headers aren't available.<br>
</div>
</blockquote>
<div><br>
</div>
<div>I just don't think the program is illegal when
LEAK_SANITIZER is not defined. The tokens within the #ifdef
are skipped completely, so they don't refer to names and
certainly don't declare anything.</div>
</div>
</blockquote>
<br>
<br>
If there was an ifdef in TableGen there'd be no problem. The trouble
is there is no ifdef...<br>
<br>
utils/TableGen/TableGen.cpp:<br>
<br>
<blockquote><code>int main(int argc, char **argv) {</code><code></code><br>
<code></code><code> sys::PrintStackTraceOnErrorSignal();</code><code></code><br>
<code></code><code> PrettyStackTraceProgram X(argc, argv);</code><code></code><br>
<code></code><code> cl::ParseCommandLineOptions(argc, argv);</code><code></code><br>
<code></code><code></code><br>
<code></code><code> return TableGenMain(argv[0],
&LLVMTableGenMain);</code><code></code><br>
<code></code><code>}</code><code></code><br>
<code></code><code></code><br>
<code></code><code>extern "C" {</code><code></code><br>
<code></code><code>// Disable LeakSanitizer for this binary as it
has too many leaks that are not</code><code></code><br>
<code></code><code>// very interesting to fix.
__lsan_is_turned_off is explained in</code><code></code><br>
<code></code><code>//
compiler-rt/include/sanitizer/lsan_interface.h</code><code></code><br>
<code></code><code><b>int __lsan_is_turned_off() { return 1; }</b></code><code></code><br>
<code></code><code>} // extern "C"</code><br>
</blockquote>
<br>
Kostya said he preferred not to conditionalize the definition, but
provide it unconditionally.<br>
<br>
That's why I've been trying to help find a name that can be
legitimately defined in ordinary builds.<br>
<br>
If that's no longer a requirement, I'm absolutely fine to guard it
with ifdef LEAK_SANITIZER and be done with it.<br>
<br>
(If that ends up being the resolution, it's a little unfortunate for
compiler-rt because a well-chosen name would have solved the problem
for all projects. Either approach is acceptable though in terms of a
resolution though from my POV.)<br>
<br>
Alp.<br>
<br>
<br>
<blockquote
cite="mid:2598408C-98A8-4FCB-9C3E-0B7930737D5C@apple.com"
type="cite">
<div>
<div><br>
</div>
<div>I'm not sure we should care about the case where
LEAK_SANITIZER is defined in an environment that doesn't
specify what defining this particular name will do. The user
has full control over this. (And in fact, IIRC being able to
define macros on the command line isn't at all specified by
the standard, so the program by itself will <i>always</i> skip
the LEAK_SANITIZER block.)</div>
<div><br>
</div>
<div>Jordan</div>
<div><br>
</div>
</div>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
<a class="moz-txt-link-freetext" href="http://www.nuanti.com">http://www.nuanti.com</a>
the browser experts
</pre>
</body>
</html>