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

    <tr>
        <th>Summary</th>
        <td>
            Wrong warning that a function is unused (Wunused-function)
        </td>
    </tr>

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

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

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

<pre>
    I am using Clang to compile a C project. It warns that one of the functions is not used (Wunused-function). When I delete the function, it does not compile anymore, because the function is missing. Looks like the warning is a false positive, it should not be emitted.

```
./../Common/assemble_bndry.c:71:28: warning: unused function 'type_index' [-Wunused-function]
   71 | static inline unsigned int type_index(MATENT_TYPE dsttype,
      | ^~~~~~~~~~
1 warning generated.
```
This is LLVM/Clang main from mid January and also occurs in Clang 19.

The project can be found at: https://gitlab.com/alberta-fem/alberta3 and it is based on GNU Autotools. What can I provide, to help debugging? Adding `-E` to my compile command did not work (or I did it wrong). The command generating the warning is:
```
/bin/sh ../../../libtool  --tag=CC   --mode=compile /home/gruenich/llvm-project/build/bin/clang -DHAVE_CONFIG_H -I. -I../../.. -Wall -Wpedantic -I../../../include -I./../0d -I./../1d -I./../2d -I./../3d -I./../Common -I../../../alberta_util/src -I../../../alberta_util/src -I../Common -I/usr/local/include      -DDIM_OF_WORLD=1 -DALBERTA_DEBUG=0 -DALBERTA_PROFILE=0 -DHAVE_ROW_FCTS_V_TYPE=1 -DHAVE_COL_FCTS_V_TYPE=1 -DHAVE_ROW_FCTS_C_TYPE=0 -DHAVE_COL_FCTS_C_TYPE=0 -Wall -Wpedantic -Wall -Wpedantic  -MT ../Common/libVV_assemble_1d_la-assemble_bndry.lo -MD -MP -MF ../Common/.deps/libVV_assemble_1d_la-assemble_bndry.Tpo -c -o ../Common/libVV_assemble_1d_la-assemble_bndry.lo `test -f '../Common/assemble_bndry.c' || echo './'`../Common/assemble_bndry.c
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJycVV2PmzgX_jXOzREITD4vuGAgtHmVdKp504n2ChnsgLfGjrCZ2bnZ3746hKTJTKuuNiII-_h8PX78mFkray1ETGYPZJZNWO8a08V11wstq2ZSGv4Wb4C10Fupa0gV0zU4A5VpT1IJYJDCqTN_isr5sHHwyjptwTXMgdECzBFcI-DY68pJoy1IC9o46K3gQOjy0Gv89C4LCF35cGiEhg1woYQTd_6EpiAdcCPOYa5V6LfWdALNpahYb-_dMGsrLXbgw9aY7xaU_H5egwVjZ9ICgyNTVsDJWOnkixiz2cb0ig_5SgGilc4J7pMgwWcejE-Q-ITmPr5S07ZYa86sFW2pRFFq3r35FYmSRUiihC5JlFwy4-cZhR_1ErpwbydRSM3FX4QugMwevA9YzTISJACwCIEsUrCOOVmB1EpqAb0edpaD1A5ugy13yX79ZV_s__i6Bm4d2ghNz6EAhlBktv778iNBEl5RqoUWHbv0f9P8vpHD5m63zzuEYOBJy6SGY2daaCWH_zHds-4NmObAlDVgqqrvLEg90ipcjajuG3EhFVRMI-xH06ObQ7Qa506WRAmhOaF5LZ1ipV-ZFhFXpegc847iZhQNKaXD-kqGQBsNn758g6R3xhmjLHKOnXNtMPOL5MPuOwONUCfgouzretisHBLOEQoyD7w1mQe4qH27UrEybYvpuDxT5tV035HppkNKy6GO187oeqA6dnrxGLHF2PfExFbv0SY0LyUyzDbgX3k3vJQssSUAz3OsJlGWpoCD1nBBouxSJqF5Y1qB-I1nHX3VS-uNwGOKXip-TVUNe-Rln5PndZE-fsk3n4rP4G18_N_UAN6BKQXe4SQ408jIezuhudSV6rlAw2Uq4Lej8G5E70bR3eh81j6mGLe-6J1UiFP3kzJ-veYaldC8tx1CYyqmbkoffl6WbXbFY14cHp-2GYmyELws2T6sn_ZJka0fvn0iURbczH19esw32_U4OyD59Hgo8nT__-J5OJFjkBHk7a9MV6_0Ygo-eN2aPmzJ-wnwdnu4Vy8ly-fn4qphIS8U895Jmj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