Skip to content

fix(clang-cl): reduce warnings #900

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

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,12 @@ if (WIN32)
target_compile_options(
mrdocs-core
PUBLIC
/permissive- # strict C++
/W4 # enable all warnings
/MP # multi-processor compilation
/EHs # C++ Exception handling
$<$<CONFIG:Debug>:/Oy-> # Disable frame pointer omission
/permissive- # strict C++
/W4 # enable all warnings
$<$<CXX_COMPILER_ID:MSVC>:/MP> # multi-processor compilation
/EHs # C++ Exception handling
$<$<CONFIG:Debug>:/Oy-> # Disable frame pointer omission
$<$<CXX_COMPILER_ID:Clang>:-Wno-unused-parameter> # ClangCL warning enabled with /W4
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't we fix the code triggering the warning instead of disabling the warning?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I made a separate commit now. I initially added this because the warnings weren't present in the output of GCC and Clang on macOS/Linux.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes. At some point we have to enable all these warnings there too. It's just that the project started without the these warnings and we always have higher priority stuff to work on.

)
endif()
endif ()
Expand Down
2 changes: 1 addition & 1 deletion src/lib/Support/LegibleNames.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class LegibleNames::Impl
If the symbolhas no name, then a reserved name based
on the type is returned instead.
*/
std::string_view
std::string
Copy link
Collaborator

Choose a reason for hiding this comment

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

:)

getRawUnqualified(SymbolID const& id)
{
Info const* I = corpus_.find(id);
Expand Down
7 changes: 3 additions & 4 deletions src/test/ADT/Polymorphic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@ struct Polymorphic_test
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wself-assign-overloaded"
#endif
#if defined(__GNUC__)
#pragma clang diagnostic ignored "-Wself-move"
#elif defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wself-move"
#endif
Expand All @@ -255,8 +255,7 @@ struct Polymorphic_test
}
#if defined(__clang__)
#pragma clang diagnostic pop
#endif
#if defined(__GNUC__)
#elif defined(__GNUC__)
#pragma GCC diagnostic pop
#endif

Expand Down
Loading