[cfe-commits] [PATCH] Treat "int (^x)()" as "int (^x)(void)" instead of a K&R style prototype

Eli Friedman eli.friedman at gmail.com
Sun May 31 13:35:46 PDT 2009


On Sun, May 31, 2009 at 12:38 PM, Chris Lattner<clattner at apple.com> wrote:
>
> On May 31, 2009, at 12:28 PM, Eli Friedman wrote:
>
>> On Sun, May 31, 2009 at 11:31 AM, Chris Lattner<clattner at apple.com> wrote:
>>>
>>> On May 31, 2009, at 8:58 AM, Fariborz Jahanian wrote:
>>>
>>>> For blocks in gcc we followed the rules for function pointers in the
>>>> host language wrt to block pointers.
>>>> This change will make it more c++-ish and may break some of our
>>>> internal projects.
>>>> But it is a new feature and it is good to tighten up the rules. So it
>>>> is OK.
>>>
>>> While I sympathize with wanting to tighten up new features, this makes
>>> block
>>> pointers work differently than function pointers.  Is it really worth it?
>>>  What problem does this solve?
>>
>> This was inspired from the following comment (and corresponding code):
>
> I think that that comment dates from when we were *trying* to be more strict
> about block types, but something backfired (I don't remember what it was)
> and we had to revert to following the base language.

I'm not strongly against the looser type compatibility, but it
definitely doesn't make sense to make them compatible while rejecting
the example from that comment.  I want to simplify the relevant code,
so I'd like a decision one way or the other.

-Eli




More information about the cfe-commits mailing list