Skip to content

Conversation

firewave
Copy link
Collaborator

@firewave firewave commented Sep 9, 2025

/home/user/CLionProjects/cppcheck/cmake-build-relwithdebinfo-clang/lib/build/mc_checkinternal.cpp:7:20: warning: unused function 'match1' [-Wunused-function]
    7 | static inline bool match1(const Token* tok) {
      |                    ^~~~~~

…compiler

```
/home/user/CLionProjects/cppcheck/cmake-build-relwithdebinfo-clang/lib/build/mc_checkinternal.cpp:7:20: warning: unused function 'match1' [-Wunused-function]
    7 | static inline bool match1(const Token* tok) {
      |                    ^~~~~~
```
Copy link

sonarqubecloud bot commented Sep 9, 2025

@firewave
Copy link
Collaborator Author

firewave commented Sep 9, 2025

Using __attribute__((unused)) causes a warning about the functions marked as unused actually being used.

@danmar
Copy link
Owner

danmar commented Sep 10, 2025

Using attribute((unused)) causes a warning about the functions marked as unused actually being used.

so we are damned if we use it and damned if we don't.. it's not preferable to use it then is it?

@firewave
Copy link
Collaborator Author

so we are damned if we use it and damned if we don't.. it's not preferable to use it then is it?

Not at all since I went for the standards attribute. So if we ever switch to C++17 we can just enable this unconditionally - and use the UNUSED from config.h. Also it is "just" matchcompiled code so nobody ever needs to deal with it except for the compiler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants