| Issue |
124469
|
| Summary |
Wrong warning that a function is unused (Wunused-function)
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
gruenich
|
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
```
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs