Skip to content

fixed/aligned some compiler warnings#3065

Merged
danmar merged 1 commit into
cppcheck-opensource:mainfrom
firewave:warn
Jan 21, 2021
Merged

fixed/aligned some compiler warnings#3065
danmar merged 1 commit into
cppcheck-opensource:mainfrom
firewave:warn

Conversation

@firewave
Copy link
Copy Markdown
Collaborator

No description provided.

Comment thread lib/config.h
# define NORETURN
#endif

// fallthrough
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is a C++-17 feature.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.
Anyway we may check if the current compiler support C++17 oder beyond...

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

feel free to change it later. I feel I will merge this as it is..

Comment thread lib/checkstl.cpp
}

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)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't it be removed instead?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually write this often myself.

@danmar danmar merged commit 491f487 into cppcheck-opensource:main Jan 21, 2021
@firewave firewave deleted the warn branch January 21, 2021 17:22
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.

4 participants