title: Conversion to non-scalar error inside macro in C
body: <p>I have the following test code in C:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  
  typedef struct test {
      int a;
      int b;
  } test_t;
  
  #define test_init(test, a)                      \
      test = (test_t)calloc(1, sizeof(test_t));   \
      (test)-&gt;a = a;                              \
      (test)-&gt;b = (test)-&gt;a + 1;                  \
  
  int main()
  {
      test_t test;
      int a = 5;
      test_init(&amp;test, a);
  
      return 0;
  }
  </code></pre>
  
  <p>But it throws the following error:</p>
  
  <pre><code>error: conversion to non-scalar type requested
  </code></pre>
  
  <p>Why exactly dos this happen? Please note that the discussion is not here whether to use an actual function or a macro. Let's just assume we are interested in macros. Why is the above error thrown, and what is the proper way to handle it?</p>