<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><BR><DIV><DIV>On Apr 8, 2009, at 5:02 AM, steve naroff wrote:</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><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></BLOCKQUOTE><DIV><BR class="khtml-block-placeholder"></DIV>In gcc,  initially we followed the rules for function pointers for lack of a detailed specification.</DIV><DIV>As usage of blocks start getting traction, we tightened the rules as outlined below.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>- Fariborz</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR><BLOCKQUOTE type="cite"><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><A href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</A><BR></DIV></BLOCKQUOTE></DIV><BR><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">cfe-commits mailing list</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</A></DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</A></DIV> </BLOCKQUOTE></DIV><BR></BODY></HTML>