<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </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 - Missing -Wuninitialized warning with some gotos"
   href="https://bugs.llvm.org/show_bug.cgi?id=43717">43717</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Missing -Wuninitialized warning with some gotos
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>trunk
          </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>enhancement
          </td>
        </tr>

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

        <tr>
          <th>Component</th>
          <td>-New Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>simon.marchi@polymtl.ca
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>htmldeveloper@gmail.com, llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Using the following 

```
#include <stdlib.h>
#include <stdio.h>

int foo;

int main() {
        int status;

        if (foo) {
                goto error;
        }

        goto end;

error:
        status = 1;

end:
        if (foo) {
                status = 1;
        }

        return status;
}
```

Unless I'm missing something, I think there's a quite obvious path (when foo is
false) where status is used without being initialized.  However, I don't get a
warning with:

$ clang-10  ~/build/babeltrace-clang/test.c -Werror -Wuninitialized
-Wsometimes-uninitialized

Removing either condition gives me -Wsometimes-uninitialized diagnostic, as
expected.

$ clang-10 --version
clang version 10.0.0-svn375132-1~exp1+0~20191017164644.1263~1.gbpd72b70 (trunk)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin</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>