<div dir="ltr">That's <a href="http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1693.pdf">http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1693.pdf</a> page 19.</div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Mon, Dec 9, 2013 at 12:29 PM, Richard Smith <span dir="ltr"><<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div class="im">On Mon, Dec 9, 2013 at 12:26 PM, Zhihao Yuan <span dir="ltr"><<a href="mailto:zy@miator.net" target="_blank">zy@miator.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div>On Mon, Dec 9, 2013 at 3:17 AM, Richard Smith <<a href="mailto:richard@metafoo.co.uk" target="_blank">richard@metafoo.co.uk</a>> wrote:<br>
>> Since this clause has no mention for _Generic, shouldn't the type of<br>
>> "hello"<br>
>> be converted from char[6] to char * when it's used as a controlling<br>
>> expression ?<br>
>> Or am I missing something ?<br>
><br>
><br>
> Yes, I think it should -- this looks like a bug. Please file a bug report!<br>
<br>
</div>I don't think so.  It looks more like an overlook to me. CC'ed Clark (the<br>
author of _Generic).<br></blockquote><div><br></div></div><div>See also <a href="http://gcc.gnu.org/ml/gcc-patches/2013-07/msg00971.html" target="_blank">http://gcc.gnu.org/ml/gcc-patches/2013-07/msg00971.html</a> and in particular:</div>
<div class="im"><br>
  "The controlling expression of a generic selection was very carefully<br>  not added to the list of contexts in which lvalue conversion is not<br></div>  done and type qualification is discarded", the minutes [from the C</div>

<div class="gmail_quote">  committee meeting] say</div><div class="im"><div class="gmail_quote"><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">


At a first glance, performing an array-to-pointer conversion make things<br>
easier, but imagine something like this:<br>
<br>
  #define F(e) _Generic(e, char *: sizeof(e))<br>
<br>
So what, sizeof a pointer is the array length?  This leads very obscure<br>
programs.  Please don't.  In unevalued context (stealing C++ term here),<br>
no convert should be performed.<br>
<br>
Here is an solution (no matter this is a bug in which side):<br>
<br>
  <a href="http://stackoverflow.com/questions/18857056/c11-generic-how-to-deal-with-string-literals" target="_blank">http://stackoverflow.com/questions/18857056/c11-generic-how-to-deal-with-string-literals</a><br>
<div><div><br>
--<br>
Zhihao Yuan, ID lichray<br>
The best way to predict the future is to invent it.<br>
___________________________________________________<br>
4BSD -- <a href="http://4bsd.biz/" target="_blank">http://4bsd.biz/</a><br>
</div></div></blockquote></div><br></div></div></div>
</blockquote></div><br></div>