Skip to content

Two warnings under NVCC #752

Closed
Closed
@henryiii

Description

@henryiii

When compiling with CUDA 8 and moving from fmt 4 to 5, I get hundreds of pages of warnings that I think boil down to two:

1

extern/fmt/include/fmt/core.h(978): warning: integer conversion resulted in a change of sign

fmt/include/fmt/core.h

Lines 976 to 979 in 5386f1d

static FMT_CONSTEXPR uint64_t get_types() {
return IS_PACKED ? internal::get_types<Context, Args...>()
: -static_cast<int64_t>(NUM_ARGS);
}

I'm not sure how this could be correct, -int is returned as uint without explicit cast?

2

extern/fmt/include/fmt/core.h(791): warning: nonstandard use of "auto" to both deduce the type from an initializer and to announce a trailing return type

fmt/include/fmt/core.h

Lines 789 to 797 in 5386f1d

basic_format_arg<Context> find(basic_string_view<char_type> name) const {
// The list is unsorted, so just return the first matching name.
for (auto it = map_, end = map_ + size_; it != end; ++it) {
if (it->name == name)
return it->arg;
}
return basic_format_arg<Context>();
}
};

Could this odd auto and comma be replaced by a decltype? (and comma, unfortunately)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions