fixed/aligned some compiler warnings#3065
Conversation
| # define NORETURN | ||
| #endif | ||
|
|
||
| // fallthrough |
There was a problem hiding this comment.
Shouldn't https://en.cppreference.com/w/cpp/language/attributes/fallthrough be preferred if available?
There was a problem hiding this comment.
That is a C++-17 feature.
There was a problem hiding this comment.
Yes.
Anyway we may check if the current compiler support C++17 oder beyond...
There was a problem hiding this comment.
We not compile Cppcheck as C++17 at all so there's not really a point in adding that. Not sure if we even want to support that. @danmar What do you think?
There was a problem hiding this comment.
I would probably prefer to use [[fallthrough]] but as this is a define we can easily select the best fit and I am not against your code. I think it's ok to use this c++17 in development builds as long as cppcheck releases can be built with an old compiler. It's not crucial that developers use c++11 as long as we have CI that do use it and test it.
There was a problem hiding this comment.
feel free to change it later. I feel I will merge this as it is..
| } | ||
|
|
||
| void CheckStl::invalidContainerError(const Token *tok, const Token * contTok, const ValueFlow::Value *val, ErrorPath errorPath) | ||
| void CheckStl::invalidContainerError(const Token *tok, const Token * /*contTok*/, const ValueFlow::Value *val, ErrorPath errorPath) |
There was a problem hiding this comment.
Can't it be removed instead?
There was a problem hiding this comment.
I actually write this often myself.
No description provided.