_Generic might not work so well to handle int vs double vs pointer-to-T.  Apparently, even unselected associations must type-check.<p>e.g.:  Here&#x27;s a simple implementation:<p><pre><code>  enum AnyKind { AnyInt, AnyDouble, AnyStr };
  
  struct Any {
      enum AnyKind kind;
      union {
          int i;
          double d;
          const char *s;
      } u;
  };
  
  #define ANY(x) \
      _Generic((x),                                               \
          int:          (struct Any){ .kind = AnyInt, .u.i = (x) },      \
          double:       (struct Any){ .kind = AnyDouble, .u.d = (x) },   \
          const char *: (struct Any){ .kind = AnyStr, .u.s = (x) })
  
  int main() {
      ANY(1);
      ANY(1.0);
      ANY(&quot;abc&quot;);
  }
</code></pre>
Clang gives errors like:<p><pre><code>  error: initializing &#x27;const char *&#x27; with an expression of incompatible type &#x27;double&#x27;
</code></pre>
This issue was discussed a bit on the GCC bugtracker: <a href="https:&#x2F;&#x2F;gcc.gnu.org&#x2F;bugzilla&#x2F;show_bug.cgi?id=64509" rel="nofollow">https:&#x2F;&#x2F;gcc.gnu.org&#x2F;bugzilla&#x2F;show_bug.cgi?id=64509</a><p>Qualifiers might also be an issue.  My impression so far is that every combination of differently qualified type is supposed to require a different _Generic association.  (GCC 5.2 and Clang 3.7 differ here.)  That would require a huge number of _Generic associations, but it might be possible to strip the qualifiers using a comma operator, _Generic( (0,(x)), ... ).  A comma expression is not an lvalue, so perhaps it cannot be qualified.  DR423[1] askes that question.<p>[1] <a href="http:&#x2F;&#x2F;www.open-std.org&#x2F;jtc1&#x2F;sc22&#x2F;wg14&#x2F;www&#x2F;docs&#x2F;dr_423.htm" rel="nofollow">http:&#x2F;&#x2F;www.open-std.org&#x2F;jtc1&#x2F;sc22&#x2F;wg14&#x2F;www&#x2F;docs&#x2F;dr_423.htm</a>