title: [C]Can I call va_arg with a larger type than the argument, then cast the value?
body: <p>I wonder if this is valid code:</p>
  
  <pre><code>int a(va_list args, int is_int, ...)
  {
      long long n = va_arg(args, long long);
      return (is_int ? ((int)n) : n);
  }
  void b(va_list args)
  {
      int x = -100;
      a(args, 1, x);
  }
  </code></pre>
  
  <p>I've written some unnecessary complicated code, I've made mistakes, and I feel like this is the simplest way to fix what I did without rewriting the whole thing, but I don't know if this can cause errors(or segfaults, or something else).</p>