[cfe-commits] [PATCH] Correctly generate K&R-style function definitions with promotable types
Chris Lattner
clattner at apple.com
Mon Aug 25 10:13:11 PDT 2008
On Aug 24, 2008, at 4:00 PM, Eli Friedman wrote:
> Patch per subject. Deals with cases like the following correctly:
>
> int a();
> int a(x) short x; {return x;}
>
> The short is supposed to promote to int for the function signature.
>
> There's a regression here because clang is now more strict about
> checking function type compatibility, but this isn't a new issue.
> Note that even ignoring the new error, this bug leads to incorrect
> codegen.
Right.
> I don't especially like the patch as written... the whole area is a
> bit messy. That said, I don't have any good ideas for how to improve
> it. Anyone have any suggestions?
The patch looks good to me, I agree that this is just a really nasty
corner of the language.
-Chris
More information about the cfe-commits
mailing list