[Cfp-interest] C1x's _Generic and totalorder()

Stephen Canon scanon at apple.com
Thu Jul 14 15:37:49 PDT 2011


On Jul 14, 2011, at 6:06 PM, Fred J. Tydeman wrote:

> On Thu, 14 Jul 2011 17:08:48 -0400 Stephen Canon wrote:
>> 
>> but it still fails for exactly the reason that Joel highlighted; _Generics expand to expressions, which _Static_assert is not.  I don't see any straightforward way around this, unfortunately.  One could replace the _Static_assert with a function that causes a runtime failure, but that's not at all satisfactory.
> 
> How about:  _Pragma( "type mismatch" )

1) The behavior of this is implementation defined; it may cause translation to fail or it may be silently ignored, or anything else may happen.
2) Whatever happens would happen unconditionally in phase 4, regardless of the types involved, so if this does cause an error, it will cause the error even when the types match.
3) Unless I'm missing something, it's still not an assignment-expression, which is what the grammar requires.

- Steve
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.oakapple.net/pipermail/cfp-interest/attachments/20110714/7b9e07e3/attachment.html 


More information about the Cfp-interest mailing list