<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 --- - Incorrect "Assigned value is always the same as the existing value""
   href="http://llvm.org/bugs/show_bug.cgi?id=15307">15307</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Incorrect "Assigned value is always the same as the existing value"
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>3.0
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>Linux
          </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>mwelinder@gmail.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 appears that the static analyzer doesn't understand C structure
copies.  The warning below would be correct without the "*a = *b;"
statement.

typedef struct {
  int x;
  int y;
} bar;

void
foo (bar *a, bar *b)
{
  int x;

  x = a->x;
  *a = *b;
  a->x = x;
}


welinder@anemone ~ $ scan-build -v make aaa.o
scan-build: 'clang' executable not found in '/usr/share/clang/scan-build/bin'.
scan-build: Using 'clang' from path: /usr/bin/clang
scan-build: Emitting reports for this run to '/tmp/scan-build-2013-02-19-5'.
/usr/share/clang/scan-build/ccc-analyzer    -c -o aaa.o aaa.c
aaa.c:13:8: warning: Assigned value is always the same as the existing value
  a->x = x;
  ~~~~ ^ ~
1 warning generated.
scan-build: 1 bugs found.

welinder@anemone ~ $ clang --version
Ubuntu clang version 3.0-6ubuntu3 (tags/RELEASE_30/final) (based on LLVM 3.0)
Target: x86_64-pc-linux-gnu
Thread model: posix</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>