<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Sep 24, 2008, at 9:32 PM, Mike Stump wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>On Sep 24, 2008, at 6:08 PM, steve naroff wrote:<br><blockquote type="cite">On Sep 24, 2008, at 9:00 PM, Mike Stump wrote:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite">On Sep 24, 2008, at 4:31 PM, Steve Naroff wrote:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">New Revision: 56595<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Downgrade incompatible block pointer error to a warning (to be consistent with incompatible pointer warnings in general).<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">:-(  In gcc these are all hard errors I believe, and I think in clang they should be hard errors as well.  Strong typing in this case I don't think poses a problem.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">I don't think you are correct. Can you please check and get back to me.<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">snaroff<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">-  short (^add1)(void) = ^{ return y+1; }; // expected-error {{incompatible block pointer types initializing 'int (^)(void)', expected 'short (^)(void)'}}<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">+  short (^add1)(void) = ^{ return y+1; }; // expected-warning {{incompatible block pointer types initializing 'int (^)(void)', expected 'short (^)(void)'}}<br></blockquote></blockquote></blockquote><br>I did that before I sent the email:<br><br>$ cat t4.c<br>main() {<br>  int y;<br>  short (^add1)(void) = ^{ return y+1; };<br>}<br>mrs $ gcc -fblocks -xc++ t4.c -c<br>t4.c: In function ‘int main()’:<br>t4.c:3: error: cannot convert ‘int (^)()’ to ‘short int (^)()’ in initialization<br>mrs $ gcc -fblocks -xc t4.c -c<br>t4.c: In function ‘main’:<br>t4.c:3: error: incompatible block pointer types initializing ‘int (^)(void)’, expected ‘short int (^)(void)’<br><br>Pretty clear to me.</div></blockquote></div><br><div>Thanks!  Unfortunately, this means the following will be considered an error.</div><div><br></div><div><div><font class="Apple-style-span" face="Courier">void foo() {</font></div><div><font class="Apple-style-span" face="Courier">  int (^xx)(const char *s) = ^(char *s) { return 1; };</font></div><div><font class="Apple-style-span" face="Courier">}</font></div><div><font class="Apple-style-span" face="Courier"><br></font></div><div><font class="Apple-style-span" face="Courier"><span class="Apple-style-span" style="font-family: Helvetica; "><div>Can you try this this on your gcc? (I don't have it handy).</div><div><br></div><div>Fariborz said we should treat this the same as function pointer assignments (which is why I made the change...).</div><div><br></div><div>Fariborz, feel free to chime in:-)</div><div><br></div><div>snaroff</div></span></font></div></div></body></html>