<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Jan 9, 2014, at 6:57 , Alp Toker <<a href="mailto:alp@nuanti.com">alp@nuanti.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span style="font-family: Helvetica; font-size: 12px; 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; background-color: rgb(255, 255, 255); float: none; display: inline !important;">I'm not making an assertion. The standard is very clear on this:</span><br style="font-family: Helvetica; font-size: 12px; 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 style="font-family: Helvetica; font-size: 12px; 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 style="font-family: Helvetica; font-size: 12px; 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;"><blockquote style="font-family: Helvetica; font-size: 12px; 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;"><b>17.6.4.3 Reserved names [reserved.names]</b><br><br>If a program declares or defines a name in a context where it is reserved, other than as explicitly allowed by this Clause, its <b>behavior is undefined</b>.<br><br><b>17.6.4.3.2 Global names [global.names]</b><br><br>Certain sets of names and function signatures are always reserved to the implementation:<br><br><ul><li><b>Each name that contains a double underscore __</b><span class="Apple-converted-space"> </span>or begins with an underscore followed by an uppercase letter (2.12) <b>is reserved to the implementation for any use</b>.</li><li>Each name that begins with an underscore is reserved to the implementation for use as a name in the global namespace.</li></ul></blockquote><br class="Apple-interchange-newline"></blockquote></div><br><div>I know I shouldn't be getting into this, but...</div><div><br></div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><b>1.3.24 undefined behavior [defns.undefined]</b></div><div>behavior for which this International Standard imposes no requirements</div><div><i>[ Note: Undefined behavior may be expected when this International Standard omits any explicit definition of behavior or when a program uses an erroneous construct or erroneous data. <b>Permissible undefined behavior</b> ranges from ignoring the situation completely with unpredictable results, <b>to behaving during translation or program execution in a documented manner characteristic of the environment</b> (with or without the issuance of a diagnostic message), to terminating a translation or execution (with the issuance of a diagnostic message). Many erroneous program constructs do not engender undefined behavior; they are required to be diagnosed. — end note ]</i></div></blockquote><div><br></div><div>(emphasis mine)</div><div><br></div><div>As I read this, a valid interpretation of this program is that when LEAK_SANITIZER is defined, the program contains undefined behavior, and therefore it should only be set in a context when the particular implementation is known to do something sensible for this particular undefined behavior (that is, use the function at runtime to disable leak checking).</div><div><br></div><div>I don't see this as abstractly different from the standard-specified practice of replacing the global operator new, so I don't think it's inherently an anti-pattern. I think everyone agrees on this since you've said already you'd have no objections if the name weren't one of the restricted [global.names] names.</div><div><br></div><div>Would it help if the function were pre-declared in a system header, and then just implemented or not implemented in user code?</div><div><br></div><div>Jordan</div></body></html>