<html><head><style>body{font-family:Helvetica,Arial;font-size:13px}</style></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">Well, I started implementation of warnings regarding availability and faced with an issue:</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">I decided to check how clang behaves and what kind of diagnostics it shows in that situation, </div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">but I've found that clang just compiles the code without any warnings.</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">I've run this command:</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="margin: 0px;">clang main.m -fsyntax-only -fmodules -Weverything</div><div id="bloop_customfont" style="margin: 0px;"><br></div><div id="bloop_customfont" style="margin: 0px;">with this code:</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">//main.m</div><div id="bloop_customfont" style="margin: 0px;"><div id="bloop_customfont" style="margin: 0px;">@import Foundation;</div><div id="bloop_customfont" style="margin: 0px;"><br></div><div id="bloop_customfont" style="margin: 0px;">@interface Future : NSObject</div><div id="bloop_customfont" style="margin: 0px;">+ (instancetype)newFuture __attribute__((availability(macosx,introduced=10.10)));</div><div id="bloop_customfont" style="margin: 0px;">@end</div><div id="bloop_customfont" style="margin: 0px;"><br></div><div id="bloop_customfont" style="margin: 0px;">@implementation Future</div><div id="bloop_customfont" style="margin: 0px;">+ (instancetype)newFuture { return nil; }</div><div id="bloop_customfont" style="margin: 0px;">@end</div><div id="bloop_customfont" style="margin: 0px;"><br></div><div id="bloop_customfont" style="margin: 0px;">int main(int argc, const char * argv[]) {</div><div id="bloop_customfont" style="margin: 0px;">  Future *f = [Future newFuture];</div><div id="bloop_customfont" style="margin: 0px;">  return f == nil;</div><div id="bloop_customfont" style="margin: 0px;">}</div></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">And everything was just fine (excerpt of unused variables argc/argv).</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">So the question is: what is expected behaviour regarding boxed expressions and availability?</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">I can’t even find such tests for NSNumber/NSString.</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">I would appreciate any suggestions or advice.</div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;"><br></div><div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">Best regards, Alex.</div> <div id="bloop_sign_1418493320057667072" class="bloop_sign"><div style="font-family:helvetica,arial;font-size:13px">-- <br>AlexDenisov</div><div style="font-family:helvetica,arial;font-size:13px">Software Engineer, <a href="https://github.com/AlexDenisov">https://github.com/AlexDenisov</a></div></div> <br><p style="color:#000;">On 11 Dec 2014 at 22:12:06, AlexDenisov (<a href="mailto:1101.debian@gmail.com">1101.debian@gmail.com</a>) wrote:</p> <blockquote type="cite" class="clean_bq"><span><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div></div><div>




<title></title>



<div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">
> there is a good chance we won’t be adding boxing of
pointers. </div>
<div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">
<br></div>
<div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">
Do you mean pointers to void (valueWithPointer) or all the
pointers, like NSObject * (valueWithNonretainedObject)?</div>
<div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">
<br></div>
<div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">
Anyway, should I get rid of that functionality before submitting
updated patch or keep it and, probably, drop later?</div>
<div id="bloop_customfont" style="font-family:Helvetica,Arial;font-size:13px; color: rgba(0,0,0,1.0); margin: 0px; line-height: auto;">
<br></div>
<div id="bloop_sign_1418332207474221056" class="bloop_sign">
<div style="font-family:helvetica,arial;font-size:13px">
-- <br>
AlexDenisov</div>
<div style="font-family:helvetica,arial;font-size:13px">Software
Engineer, <a href="https://github.com/AlexDenisov">https://github.com/AlexDenisov</a></div>
</div>
<br>
<p style="color:#000;">On 10 Dec 2014 at 23:00:38, jahanian
(<a href="mailto:fjahanian@apple.com">fjahanian@apple.com</a>)
wrote:</p>
<blockquote type="cite" class="clean_bq">
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
<div><span><br class=""></span>
<div>
<blockquote type="cite" class="">
<div class=""><span>On Dec 9, 2014, at 12:21 AM, AlexDenisov
<<a href="mailto:1101.debian@gmail.com" class="">1101.debian@gmail.com</a>> wrote:</span></div>
<div class="">
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; 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; margin: 0px;" class=""><span><br class=""></span>
<div id="bloop_customfont" style="margin: 0px;" class="">
<span><br class=""></span></div>
<div id="bloop_customfont" style="margin: 0px;" class="">
<span>>> Also, why can’t place this under the umbrella
objc_boxed_expressions?</span></div>
<div id="bloop_customfont" style="margin: 0px;" class="">
<span><br class=""></span></div>
<div id="bloop_customfont" style="margin: 0px;" class="">
<span>Version 3.5, for example, supports objc_boxed_expression but
not NSValue+boxed_expressions, </span></div>
<div id="bloop_customfont" style="margin: 0px;" class="">
<span>which might cause weird compilation fails. Or did I get it
wrong?</span></div>
</div>
</div>
</blockquote>
<span>No wrong :).</span></div>
<div><span><br class=""></span>
<blockquote type="cite" class="">
<div class="">
<div id="bloop_customfont" style="font-family: Helvetica, Arial; font-size: 13px; 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; margin: 0px;" class="">
<div id="bloop_customfont" style="margin: 0px;" class="">
<span><br class=""></span></div>
<div id="bloop_customfont" style="margin: 0px;" class=""><span>+
       // Otherwise, require a declaration of
NSValue.</span></div>
<div id="bloop_customfont" style="margin: 0px;" class=""><span>+
       S.Diag(Loc,
diag::err_undeclared_nsvalue);</span></div>
<div id="bloop_customfont" style="margin: 0px;" class=""><span>+
       return nullptr;</span></div>
<div id="bloop_customfont" style="margin: 0px;" class=""><span>+
     }</span></div>
<div id="bloop_customfont" style="margin: 0px;" class=""><span>+
   } else if (!S.NSValueDecl->hasDefinition())
{</span></div>
<div id="bloop_customfont" style="margin: 0px;" class=""><span>+
     S.Diag(Loc,
diag::err_undeclared_nsvalue);</span></div>
<div id="bloop_customfont" style="margin: 0px;" class="">
<span><br class=""></span></div>
<div id="bloop_customfont" style="margin: 0px;" class="">
<span>>> Maybe we should have a clearer diagnostic
here.</span></div>
<div id="bloop_customfont" style="margin: 0px;" class="">
<span><br class=""></span></div>
<div id="bloop_customfont" style="margin: 0px;" class="">
<span>Makes sense, I used NSNumber' implementation here. I'd
appreciate any suggestions or advice on </span></div>
<div id="bloop_customfont" style="margin: 0px;" class=""><span>how
to improve diagnostic here (and, probably, for
NSNumber)</span></div>
</div>
</div>
</blockquote>
<div><span><br class=""></span></div>
<span>Probably should allude to NSValue (or NSNumber) having no
definition (only forward declared).  </span></div>
<div><span>But, it is not something I strongly argue
for.</span></div>
<div><span><br class=""></span></div>
<div><span>P.S. there is a good chance we won’t be adding boxing of
pointers. </span></div>
<div><span><br class=""></span></div>
<div><span>Thanks, Fairborz</span></div>
<div><span><br class=""></span></div>
<div><span><br class=""></span></div>
<span><br class=""></span></div>
</div>
</blockquote>


</div></div></span></blockquote></body></html>