From 925db2308998bb4a75db70cbf4ee1f7fc9daf9c7 Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Wed, 23 Apr 2025 22:38:26 +0200 Subject: [PATCH 1/2] fix(clang-cl): reduce warnings --- CMakeLists.txt | 11 ++++++----- src/lib/Support/LegibleNames.cpp | 2 +- src/test/ADT/Polymorphic.cpp | 7 +++---- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8cf953cd8..9a4d96f59 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 - $<$:/Oy-> # Disable frame pointer omission + /permissive- # strict C++ + /W4 # enable all warnings + $<$:/MP> # multi-processor compilation + /EHs # C++ Exception handling + $<$:/Oy-> # Disable frame pointer omission + $<$:-Wno-unused-parameter> # ClangCL warning enabled with /W4 ) endif() endif () diff --git a/src/lib/Support/LegibleNames.cpp b/src/lib/Support/LegibleNames.cpp index 23bad65f0..8b10d3192 100644 --- a/src/lib/Support/LegibleNames.cpp +++ b/src/lib/Support/LegibleNames.cpp @@ -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 getRawUnqualified(SymbolID const& id) { Info const* I = corpus_.find(id); diff --git a/src/test/ADT/Polymorphic.cpp b/src/test/ADT/Polymorphic.cpp index 941e1ba11..dce6fbd38 100644 --- a/src/test/ADT/Polymorphic.cpp +++ b/src/test/ADT/Polymorphic.cpp @@ -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 @@ -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 From c3d6cd3829c00a67dc855c08d096c46ad86465fe Mon Sep 17 00:00:00 2001 From: Nerixyz Date: Mon, 5 May 2025 19:56:14 +0200 Subject: [PATCH 2/2] fix: remove (names of) unused arguments --- include/mrdocs/Metadata/Info/Friend.hpp | 2 +- include/mrdocs/Metadata/Javadoc.hpp | 2 +- src/lib/Lib/CorpusImpl.cpp | 2 +- src/lib/Metadata/Finalizers/Javadoc/Function.hpp | 6 +++--- src/lib/Metadata/Finalizers/JavadocFinalizer.cpp | 2 +- src/lib/Support/Handlebars.cpp | 4 ++-- src/lib/Support/Lua.cpp | 6 +++--- src/test/lib/Support/Handlebars.cpp | 10 +++++----- src/test_suite/test_suite.cpp | 2 +- 9 files changed, 18 insertions(+), 18 deletions(-) diff --git a/include/mrdocs/Metadata/Info/Friend.hpp b/include/mrdocs/Metadata/Info/Friend.hpp index 6819dff77..b59185a4e 100644 --- a/include/mrdocs/Metadata/Info/Friend.hpp +++ b/include/mrdocs/Metadata/Info/Friend.hpp @@ -43,7 +43,7 @@ merge(FriendInfo& I, FriendInfo&& Other); template void tag_invoke( - dom::LazyObjectMapTag t, + dom::LazyObjectMapTag, IO& io, FriendInfo const& I, DomCorpus const* domCorpus) diff --git a/include/mrdocs/Metadata/Javadoc.hpp b/include/mrdocs/Metadata/Javadoc.hpp index b00d249cb..787f0c596 100644 --- a/include/mrdocs/Metadata/Javadoc.hpp +++ b/include/mrdocs/Metadata/Javadoc.hpp @@ -1873,7 +1873,7 @@ void merge(Javadoc& I, Javadoc&& other) template void tag_invoke( - dom::LazyObjectMapTag t, + dom::LazyObjectMapTag, IO& io, Javadoc const& I, DomCorpus const* domCorpus) diff --git a/src/lib/Lib/CorpusImpl.cpp b/src/lib/Lib/CorpusImpl.cpp index 22233d535..c58c1cb10 100644 --- a/src/lib/Lib/CorpusImpl.cpp +++ b/src/lib/Lib/CorpusImpl.cpp @@ -119,7 +119,7 @@ findFirstParentInfo( MRDOCS_CHECK_OR(contextUniquePtr, SymbolID::invalid); auto& context = *contextUniquePtr; bool const isParent = visit(context, []( - InfoTy const& I) -> bool + InfoTy const&) -> bool { return InfoParent; }); diff --git a/src/lib/Metadata/Finalizers/Javadoc/Function.hpp b/src/lib/Metadata/Finalizers/Javadoc/Function.hpp index 3b7f440d8..6be35c1b2 100644 --- a/src/lib/Metadata/Finalizers/Javadoc/Function.hpp +++ b/src/lib/Metadata/Finalizers/Javadoc/Function.hpp @@ -107,7 +107,7 @@ innermostTypenameString(Polymorphic const& T) } bool -populateFunctionBriefFromClass(FunctionInfo& I, CorpusImpl const& corpus) +populateFunctionBriefFromClass(FunctionInfo& I) { switch (I.Class) { @@ -237,10 +237,10 @@ populateFunctionBriefFromOperator(FunctionInfo& I) } void -populateFunctionBrief(FunctionInfo& I, CorpusImpl const& corpus) +populateFunctionBrief(FunctionInfo& I) { MRDOCS_CHECK_OR(!I.javadoc->brief); - MRDOCS_CHECK_OR(!populateFunctionBriefFromClass(I, corpus)); + MRDOCS_CHECK_OR(!populateFunctionBriefFromClass(I)); MRDOCS_CHECK_OR(!populateFunctionBriefFromOperator(I)); } diff --git a/src/lib/Metadata/Finalizers/JavadocFinalizer.cpp b/src/lib/Metadata/Finalizers/JavadocFinalizer.cpp index 36932562d..a694e58cf 100644 --- a/src/lib/Metadata/Finalizers/JavadocFinalizer.cpp +++ b/src/lib/Metadata/Finalizers/JavadocFinalizer.cpp @@ -565,7 +565,7 @@ populateFunctionJavadoc(FunctionInfo& I) const } // Populate a missing javadoc brief - populateFunctionBrief(I, corpus_); + populateFunctionBrief(I); // Populate a missing javadoc returns populateFunctionReturns(I, corpus_); diff --git a/src/lib/Support/Handlebars.cpp b/src/lib/Support/Handlebars.cpp index 43db33169..8898e6d13 100644 --- a/src/lib/Support/Handlebars.cpp +++ b/src/lib/Support/Handlebars.cpp @@ -2144,7 +2144,7 @@ parseBlock( HandlebarsOptions const& opt, detail::RenderState const& state, std::string_view &templateText, - OutputRef &out, + OutputRef &, std::string_view &fnBlock, std::string_view &inverseBlocks, Handlebars::Tag &inverseTag, @@ -3664,7 +3664,7 @@ each_fn(dom::Value context, dom::Value const& options) { dom::Value priorKey; auto exp = context.getObject().visit([&]( - dom::String const& key, dom::Value const& value) -> Expected + dom::String const& key, dom::Value const&) -> Expected { if (!priorKey.isUndefined()) { diff --git a/src/lib/Support/Lua.cpp b/src/lib/Support/Lua.cpp index eee6bde0c..92d88a574 100644 --- a/src/lib/Support/Lua.cpp +++ b/src/lib/Support/Lua.cpp @@ -210,7 +210,7 @@ static void luaM_report( Error const& err, - source_location loc = + source_location = source_location::current()) { SourceLocation Loc(err.location()); @@ -605,7 +605,7 @@ domValue_push( static char const* Reader( - lua_State *L, + lua_State *, void* data, size_t* size) { @@ -675,7 +675,7 @@ Expected Scope:: getGlobal( std::string_view key, - source_location loc) + source_location) { Access A(*this); lua_pushglobaltable(A); diff --git a/src/test/lib/Support/Handlebars.cpp b/src/test/lib/Support/Handlebars.cpp index 61434fc3c..f923d6804 100644 --- a/src/test/lib/Support/Handlebars.cpp +++ b/src/test/lib/Support/Handlebars.cpp @@ -3863,7 +3863,7 @@ helpers() // pathed lambas with parameters { dom::Object hash; - dom::Function helper = dom::makeInvocable([](dom::Value const& arg) { + dom::Function helper = dom::makeInvocable([](dom::Value const&) { return dom::Value("winning"); }); hash.set("helper", helper); @@ -4457,7 +4457,7 @@ helpers() // should take precedence over helper values { std::string string = "{{#goodbyes as |value|}}{{value}}{{/goodbyes}}{{value}}"; - hbs.registerHelper("value", [](dom::Value const& options) { + hbs.registerHelper("value", [](dom::Value const&) { return "foo"; }); hbs.registerHelper("goodbyes", [](dom::Value const& options) { @@ -4668,8 +4668,8 @@ track_ids() hbs.registerHelper("wycats", []( dom::Value const& passiveVoice, dom::Value const& noun, - dom::Value const& thiz, - dom::Value const& thiz2, + dom::Value const&, + dom::Value const&, dom::Value const& options) { BOOST_TEST(options.get("ids").get(0) == "is.a"); BOOST_TEST(options.get("ids").get(1) == "../slave.driver"); @@ -4768,7 +4768,7 @@ track_ids() hbs.registerHelper("wycats", []( dom::Value const& passiveVoice, dom::Value const& noun, - dom::Value const& blah, + dom::Value const&, dom::Value const& options) { BOOST_TEST(options.get("ids").get(0) == "zomg.a"); diff --git a/src/test_suite/test_suite.cpp b/src/test_suite/test_suite.cpp index d502b7840..0545157bd 100644 --- a/src/test_suite/test_suite.cpp +++ b/src/test_suite/test_suite.cpp @@ -486,7 +486,7 @@ int run(std::ostream& out) // Simple main used to produce standalone // executables that run unit tests. -int unit_test_main(int argc, char const* const* argv) +int unit_test_main(int, char const* const*) { #if 0 #if defined(_MSC_VER) && !defined(__clang__)