Skip to content

Treat all warnings as errors #288

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

Merged

Conversation

mcbarton
Copy link
Collaborator

@mcbarton mcbarton commented May 15, 2024

This PR will add the flag to treat all warnings as errors when building the ci.
Fixes #260
Fixes #234

@mcbarton mcbarton changed the title [WIP] Treat all warnings as errors (fix some warnings) [WIP] Treat all warnings as errors May 15, 2024
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

4 similar comments
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@mcbarton mcbarton force-pushed the Treat-all-warnings-as-errors branch from cd4f137 to a4a5949 Compare May 15, 2024 20:26
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@mcbarton mcbarton force-pushed the Treat-all-warnings-as-errors branch from 1b78f31 to 0d27bbc Compare May 16, 2024 21:09
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link

codecov bot commented May 16, 2024

Codecov Report

Attention: Patch coverage is 85.71429% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 54.37%. Comparing base (f20c606) to head (dd5f7d9).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #288      +/-   ##
==========================================
+ Coverage   54.31%   54.37%   +0.06%     
==========================================
  Files           8        8              
  Lines        2957     2959       +2     
==========================================
+ Hits         1606     1609       +3     
+ Misses       1351     1350       -1     
Files Coverage Δ
lib/Interpreter/Compatibility.h 77.31% <ø> (ø)
lib/Interpreter/DynamicLibraryManager.cpp 72.37% <ø> (ø)
lib/Interpreter/DynamicLibraryManagerSymbol.cpp 67.65% <ø> (ø)
lib/Interpreter/CppInterOp.cpp 50.59% <85.71%> (+0.11%) ⬆️
Files Coverage Δ
lib/Interpreter/Compatibility.h 77.31% <ø> (ø)
lib/Interpreter/DynamicLibraryManager.cpp 72.37% <ø> (ø)
lib/Interpreter/DynamicLibraryManagerSymbol.cpp 67.65% <ø> (ø)
lib/Interpreter/CppInterOp.cpp 50.59% <85.71%> (+0.11%) ⬆️

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

15 similar comments
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@mcbarton mcbarton force-pushed the Treat-all-warnings-as-errors branch from b035ff1 to 3b35433 Compare May 18, 2024 09:40
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

4 similar comments
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@mcbarton mcbarton force-pushed the Treat-all-warnings-as-errors branch from f5eed09 to ada0a3a Compare May 18, 2024 17:59
@mcbarton mcbarton changed the title [WIP] Treat all warnings as errors Treat all warnings as errors May 18, 2024
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@mcbarton mcbarton marked this pull request as ready for review May 18, 2024 18:38
static int s_a; \
} c; \
int C::s_a = 12;
#else
Copy link
Contributor

Choose a reason for hiding this comment

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

Likewise.

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

2 similar comments
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-private-field"
CODE;
#pragma GCC diagnostic pop
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's drop the pragmas and make classes structs. This way the m_* will become public and will make the warning go away.

Copy link
Collaborator Author

@mcbarton mcbarton May 18, 2024

Choose a reason for hiding this comment

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

@vgvassilev That will fix most warnings, but this won't fix the warning about N from the line const int N = 5; being unused VariableReflectionTest.cpp. This warning about it being unused only occurs on osx I believe.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

https://github.com/compiler-research/CppInterOp/actions/runs/9142202412/job/25137488586?pr=288#step:15:185 Link to error with const int N = 5; Unless there is a specific reason its being labelled const then I can try fixing it by removing the const?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Testing removing const to fix. Will revert and try something else if needed

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

1 similar comment
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@mcbarton mcbarton force-pushed the Treat-all-warnings-as-errors branch from 76526c8 to e546ec4 Compare May 18, 2024 20:33
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@mcbarton
Copy link
Collaborator Author

@vgvassilev This PR is ready for further review.

@mcbarton mcbarton force-pushed the Treat-all-warnings-as-errors branch from e546ec4 to bcb8a7c Compare May 18, 2024 21:42
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@@ -93,7 +93,7 @@ TEST(VariableReflectionTest, GetVariableType) {

#define CODE \
int a; \
const int N = 5; \
Copy link
Contributor

Choose a reason for hiding this comment

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

We can’t change that because this changes the intent of the test. Maybe use it in the struct definition below to initialize some member.

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@mcbarton
Copy link
Collaborator Author

@vgvassilev I have tried to address your comment about retaining N as const. This PR is ready for further review.

Copy link
Contributor

@vgvassilev vgvassilev left a comment

Choose a reason for hiding this comment

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

LGTM!

@vgvassilev vgvassilev merged commit 45794b0 into compiler-research:main May 19, 2024
@mcbarton mcbarton deleted the Treat-all-warnings-as-errors branch May 22, 2024 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci CI workflows cmake Build systems tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix all bot warnings and enable -Werror Clean up all warnings and enable -Werror
3 participants