<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Apr 7, 2009, at 11:01 PM, Eli Friedman wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>On Tue, Apr 7, 2009 at 7:56 PM, Anders Carlsson <<a href="mailto:andersca@mac.com">andersca@mac.com</a>> wrote:<br><blockquote type="cite">Author: andersca<br></blockquote><blockquote type="cite">Date: Tue Apr  7 21:55:55 2009<br></blockquote><blockquote type="cite">New Revision: 68583<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">URL: <a href="http://llvm.org/viewvc/llvm-project?rev=68583&view=rev">http://llvm.org/viewvc/llvm-project?rev=68583&view=rev</a><br></blockquote><blockquote type="cite">Log:<br></blockquote><blockquote type="cite">Don't assume that a block always has a FunctionProtoType. Fixes <a href="rdar://6768379">rdar://6768379</a>.<br></blockquote><br>Maybe we should make "int (^a0)()" and "int (^a0)(void)" equivalent?</div></blockquote><div><br></div>I agree with you. IIRC this is what I originally implemented (in clang). I forget what motivated us to support K&R style as a "convenience" (see excerpt below). Fariborz?</div><div><br></div><div>snaroff</div><div><br></div><div>Here is an excerpt from the Blocks spec:</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 14px/normal Helvetica; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 14px/normal Helvetica; "><b>Block Variable Declarations</b></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; ">A variable with Block type is declared using function pointer style notation substituting <span style="font: 10.0px Monaco">^</span> for <span style="font: 10.0px Monaco">*</span>. The following are valid Block variable declarations:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">    void (^blockReturningVoidWithVoidArgument)(void);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">    int (^blockReturningIntWithIntAndCharArguments)(int, char);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Monaco; ">    void (^arrayOfTenBlocksReturningVoidWithIntArgument[10])(int);</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; min-height: 14px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; ">Variadic <span style="font: 10.0px Monaco">...</span> arguments are supported. [variadic.c]  A Block that takes no arguments must specify void in the argument list [voidarg.c].  An empty parameter list does not represent, as K&R provide, an unspecified argument list.  Note: both gcc and clang support K&R style as a convenience.</div><div><font class="Apple-style-span" size="3"><span class="Apple-style-span" style="font-size: 12px;"><br></span></font></div></div></div><div><br><blockquote type="cite"><div><br>There's no compatibility reason to keep around functions without<br>prototypes...<br><br>-Eli<br><br>_______________________________________________<br>cfe-commits mailing list<br><a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br>http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits<br></div></blockquote></div><br></body></html>