Skip to content

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

Merged
danmar merged 5 commits intocppcheck-opensource:mainfrom
firewave:warn
Oct 9, 2023
Merged

mitigated several compiler warnings / suppress compiler warnings in CI where we don't care about them#5497
danmar merged 5 commits intocppcheck-opensource:mainfrom
firewave:warn

Conversation

@firewave
Copy link
Copy Markdown
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 firewave marked this pull request as draft September 29, 2023 08:33
@firewave firewave marked this pull request as ready for review September 29, 2023 09:21
@firewave
Copy link
Copy Markdown
Collaborator Author

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

Comment thread lib/utils.h
@danmar danmar merged commit 2f62e9d into cppcheck-opensource:main Oct 9, 2023
@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 cppcheck-opensource#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

Development

Successfully merging this pull request may close these issues.

2 participants