Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mitigated several compiler warnings / suppress compiler warnings in CI where we don't care about them #5497

Merged
merged 5 commits into from Oct 9, 2023

Conversation

firewave
Copy link
Collaborator

There's no need to generate any warnings in the CI unless we react on them.

@firewave firewave changed the title perform build with latest GCC in script check and bail out on warnings / mitigated several compiler warnings perform build with latest GCC in scriptcheck and bail out on warnings / mitigated several compiler warnings Sep 29, 2023
@firewave firewave changed the title perform build with latest GCC in scriptcheck and bail out on warnings / mitigated several compiler warnings perform build with latest GCC in scriptcheck / mitigated several compiler warnings Sep 29, 2023
@firewave firewave changed the title perform build with latest GCC in scriptcheck / mitigated several compiler warnings mitigated several compiler warnings / suppress compiler warnings in CI where we don't care about them Sep 29, 2023
@firewave firewave marked this pull request as ready for review September 29, 2023 07:39
@firewave
Copy link
Collaborator Author

I added a ticket about cases we should bail out on warnings on: https://trac.cppcheck.net/ticket/12021

lib/utils.h Show resolved Hide resolved
@danmar danmar merged commit 2f62e9d into danmar:main Oct 9, 2023
143 checks passed
@firewave firewave deleted the warn branch October 9, 2023 10:42
StefanVK added a commit to StefanVK/cppcheck that referenced this pull request Nov 11, 2023
When building with /Od - default cmake debug build for me, the __assume(false); trick does not work to get rid of the C4714 warnings

https://godbolt.org/z/a6xGnfP7d

D:\tmp\cppcheck\lib\keywords.cpp(205): warning C4715: 'Keywords::getOnly': not all control paths return a value
D:\tmp\cppcheck\lib\keywords.cpp(226): warning C4715: 'Keywords::getOnly': not all control paths return a value
D:\tmp\cppcheck\lib\keywords.cpp(168): warning C4715: 'Keywords::getAll': not all control paths return a value
D:\tmp\cppcheck\lib\keywords.cpp(188): warning C4715: 'Keywords::getAll': not all control paths return a value

Proposed fix: also define NORETURN to [[noreturn]] when according to __has_cpp_attribute [[noreturn]] is supported https://en.cppreference.com/w/cpp/feature_test

(For previous discussion see also danmar#5497)
firewave pushed a commit that referenced this pull request Nov 12, 2023
When building with /Od - default cmake debug build for me, the
__assume(false); trick does not work to get rid of the C4714 warnings

https://godbolt.org/z/a6xGnfP7d

D:\tmp\cppcheck\lib\keywords.cpp(205): warning C4715:
'Keywords::getOnly': not all control paths return a value
D:\tmp\cppcheck\lib\keywords.cpp(226): warning C4715:
'Keywords::getOnly': not all control paths return a value
D:\tmp\cppcheck\lib\keywords.cpp(168): warning C4715:
'Keywords::getAll': not all control paths return a value
D:\tmp\cppcheck\lib\keywords.cpp(188): warning C4715:
'Keywords::getAll': not all control paths return a value

Proposed fix: also define NORETURN to [[noreturn]] when according to
__has_cpp_attribute [[noreturn]] is supported
https://en.cppreference.com/w/cpp/feature_test

(For previous discussion see also
#5497)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants