title: C Macro with varargs
body: <p>I am trying to write a macro which returns the smallest value of several integers. When I compile the following code, it throws an error "expected expression". I don't know what's wrong there. Could anyone point out the issues with this code?</p>
  
  <pre><code>#define SMALLEST (nums, (ret_val), ...)          \
  do {                                             \
      int i, val;                                  \
      va_list vl;                                  \
      va_start(vl,nums);                           \
      (*ret_val) = va_arg(vl, int);                \
      for (i = 1; i &lt; nums; i++)                   \
      {                                            \
          val=va_arg(vl, int);                     \
          if ((*ret_val) &gt; val)                    \
              (*ret_val) = val;                    \
      }                                            \
      va_end(vl);                                  \
  } while(0)
  
  int main ()
  {
    int nums = 3;
    int ret_val = 0;
    SMALLEST(nums, &amp;ret_val, 1, 2, 3);
    return 0;
  }
  </code></pre>
  
  <p>I am just curious about how to do it with Macro. </p>