Skip to content
Merged
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
3 changes: 2 additions & 1 deletion include/tvm/ffi/reflection/overload.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ struct TypedOverload : OverloadBase {

private:
template <std::size_t I>
void GetMismatchMessageAux(std::ostringstream& os, const AnyView* args, int32_t num_args) {
void GetMismatchMessageAux(std::ostringstream& os, const AnyView* args,
[[maybe_unused]] int32_t num_args) {
Comment on lines +148 to +149
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

While [[maybe_unused]] correctly suppresses the compiler warning, a cleaner solution would be to remove the num_args parameter from GetMismatchMessageAux entirely, as it is not used. This would improve code clarity by removing the unneeded parameter and would require updating its call sites.

if constexpr (I < kNumArgs) {
if (this->last_mismatch_index_ == static_cast<int32_t>(I)) {
TVMFFIAny any_data = args[I].CopyToTVMFFIAny();
Expand Down
2 changes: 1 addition & 1 deletion tests/cpp/test_function.cc
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ TEST(SetRaisedFromCStrParts, TypeError) {

int testing_add1(int x) { return x + 1; }

TVM_FFI_DLL_EXPORT_TYPED_FUNC(testing_add1, testing_add1);
TVM_FFI_DLL_EXPORT_TYPED_FUNC(testing_add1, testing_add1)

TEST(Func, FromExternC) {
// this is the function abi convention
Expand Down