[cfe-dev] _Generic constant string as controlling expression

Zhihao Yuan zy at miator.net
Sun Dec 8 14:54:15 PST 2013


On Sun, Dec 8, 2013 at 5:16 PM, Prathamesh Kulkarni
<bilbotheelffriend at gmail.com> wrote:
> f.c:5:20: error: controlling expression type 'char [6]' not compatible
> with any generic association type
>   int a = _Generic("hello", char *: 1);

"Convertible" does not mean "compatible", neither is a subset
of another; see 6.2.7.

At least, an array type is not compatible with a non-array type,
like a pointer.

-- 
Zhihao Yuan, ID lichray
The best way to predict the future is to invent it.
___________________________________________________
4BSD -- http://4bsd.biz/



More information about the cfe-dev mailing list