<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/82909>82909</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            scan-build-16 says that the analyzer encountered a problem...
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          sebras
      </td>
    </tr>
</table>

<pre>
    I was running scan-build-16 on my project and it failed on a file.
I've reduced the file as much as I can and it still fails for me:

[sample.tar.gz](https://github.com/llvm/llvm-project/files/14395486/sample.tar.gz)

```$ scan-build-16 -o o make
scan-build: Using '/usr/lib/llvm-16/bin/clang' for static analysis
/usr/share/clang/scan-build-16/bin/../libexec/ccc-analyzer  -o file.o -c file.c
file.c: In function ‘f’:
file.c:1:18: warning: returning ‘void *’ from a function with return type ‘int’ makes integer from pointer without a cast [-Wint-conversion]
    1 | int f() { return (void *) 0; }
      |                  ^
file.c:1:18: error: incompatible pointer to integer conversion returning 'void *' from a function with result type 'int' [-Wint-conversion]
int f() { return (void *) 0; }
                 ^~~~~~~~~~
1 error generated.
scan-build: Analysis run complete.
scan-build: 0 bugs found.
scan-build: The analyzer encountered problems on some source files.
scan-build: Preprocessed versions of these sources were deposited in '/home/user/src/mupdf/judy/o/2024-02-25-142243-2591236-1/failures'.
scan-build: Please consider submitting a bug report using these files:
scan-build:   http://clang-analyzer.llvm.org/filing_bugs.html
```                 

The problematic code is entirely visible in the log above. Yes, I know that the code makes no sense, but the scan-build tool asks me to report a bug because it encountered an issue. I'm not quite sure what that issue is, but I'm betting on that you do! :)

A tarball of the output directory `o` is here:
[o.tar.gz](https://github.com/llvm/llvm-project/files/14395490/o.tar.gz)

I obtained scan-build-16 and clang-16 from Debian/testing
https://packages.debian.org/trixie/amd64/clang-tools-16/download
https://packages.debian.org/trixie/amd64/clang-16/download

$ clang --version
Debian clang version 16.0.6 (19)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

I have similarly tried with scan-build-14, scan-build-15 and scan-build-17:
Debian clang version 14.0.6
Debian clang version 15.0.7
Debian clang version 17.0.6 (5)

Both scan-build-15 and scan-build-17 fail similarly to scan-build-16, but scan-build-14 succeeds without encountering any problems.

Please let me know if I can provide any further information.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysVk-P-jgS_TTmUkqUmJCEA4fu6UHq2x5mtdrTyIkL8LRjs_7TNHPYz74q5w_Qw_yk3R3UDQGXy69eVb2y8F4dDeKObV7Z5m0lYjhZt_PYOeFXnZXX3TtchAcXjVHmCL4XJuui0jIra7AGhiucnf0N-wDCSFABDkJplLQm4KA05qx4Y8XLO-PNJ4JDGXuUEE6YVkF4GGJ_os936IWZ3figtE7OPBysgwHZ-mV0Nb1vXr0YzhrzIFx-_J1t3hhvTyGcPVnyPeP7owqn2OW9HRjfa_05f2QTZsb3BMIzvi-r9XZTtTXj-0e3fPtwal1Mf7z6xkZmwcIgPnC0vC2y9Qv83RN9jDeM76N3hEN1M5qSTu2UYXzfa2GOjDcpZh9EUD0II_TVKz8hmB34k3B427J_QLM4zPPxLPzCnoz7Pkv-fkcHBDmlyELWj0_9eMj0vH6BdwOHaPqgrAH2M2dtwbbtYX7aLklZdpT039LWi3BUNPToMMT05ebj0yoJjL8sruDg7EBFMx93UeE07YRwPeNtrzLhto0o96BMwCO60cnZ0leXPNgYQEAvfAC2ec3-oUzIems-0XllDVVNwg8AUAJrfiJPcGC8ZXwLrHmdETB-g8y3ULD1K7Dmbjek3X94sc3Pf8oQOmcdPSjT2-Esguo0LuiDXaK6Ab6nkjc3RM2f0eejDhN9vCHiePNDIv738B-D_vf8Gk3KMVg4okEnAsr8WZu8TKVOggNEicaATy0L6OKRpCGa565-OSEslY6mt5FIRUl61WkcPEmUtwOCt9H1oxz5p67-5vDsbI_eo4SJLw_2QCrm5_0eLugQJJ6tVwElKDP1-8kO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