<html>
    <head>
      <base href="http://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - static analyzer should warn on use of va_arg() macro before call to va_start() macro or after call to va_end() macro"
   href="http://llvm.org/bugs/show_bug.cgi?id=16812">16812</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>static analyzer should warn on use of va_arg() macro before call to va_start() macro or after call to va_end() macro
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>unspecified
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Static Analyzer
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>kremenek@apple.com
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>oohrah@mac.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>It would be nice if the static analyzer gave a warning about use of va_arg()
before the call to va_start() and one about use of va_arg() after the call to
va_end() with this code:


static void func(const char *format, ...)
{
    va_list arguments;

    int x = va_arg(arguments, int);

    va_start (arguments, format);

    vprintf(format, arguments);

    va_end (arguments);

    int y = va_arg(arguments, int);

    printf("x + y = %d\n", (x + y));
}</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>