On Oct 11, 2011, at 8:30 AM, Douglas Gregor wrote:

> Alternatively, we could take returns_twice out of the type system entirely. 
> Is there value in declaring a function pointer to a returns_twice function, 
> and having that be a distinct type from a similar function pointer to any 
> function? If not, then perhaps returns_twice should be just a declaration 
> attribute, and not have any impact on the type system. 

The thought of calling vfork() through a function pointer is very scary indeed, 
but the calling function needs to know that the called function may return 
twice.

The returns_twice attribute affects code generation in the caller, not in the 
callee.

I think that means it needs to be a type attribute.

However, if we allow this:

  int (*fptr)(jmp_buf) = &setjmp;

We lose the information anyway.

/jakob

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to