[cfe-commits] [patch] Falling off main() returns zero

Fariborz Jahanian fjahanian at apple.com
Mon Jul 27 16:47:48 PDT 2009

On Jul 27, 2009, at 4:33 PM, John McCall wrote:

> Fariborz Jahanian wrote:
>> On Jul 27, 2009, at 3:33 PM, Daniel Dunbar wrote:
>>> I think what Fariborz was asking for was to actually modify the AST
>>> for main to return 0, change the type, etc.
>> No. I just wanted AST to carry the info. somehow, so clients do not
>> deduce this based on target language. An analogy being that
>> we put enough info. in the ASTs for synthesized ivars so clients can
>> do this.
> So would something like Eli's suggestion be sufficient — i.e. just  
> changing the triggering condition on my original patch to some sort  
> of AST-hosted "has well-defined implicit return" predicate, which  
> would currently just defer to isMain()?  I've been experimenting  
> with synthesizing return statements, and it feels like that would be  
> a much more intrusive change for clients.

I tend to like Doug's suggestion a bit more. Having an implicit return  
AST makes it free of any specific function and
may come handy for other purposes in the future.
You can also do Eli's suggestion with a FIXME for possible change.

- Fariborz

> John.
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

More information about the cfe-commits mailing list