Skip to content

compilation error on msvc with FMT_EXCEPTIONS=0 #144

Closed
@sbrednikhin

Description

@sbrednikhin

error C4716: 'anonymous namespace'::PrecisionHandler::visit_unhandled_arg' : must return a value ..\cppformat\format.cc 334 error C4716: 'anonymous namespace'::WidthHandler::visit_unhandled_arg' : must return a value ..\cppformat\format.cc 312

FMT_NO_RETURN works wrong

FMT_NORETURN
unsigned visit_unhandled_arg() {
FMT_THROW(fmt::FormatError("width is not integer"));
}

Maybe it's better to return something instead?

FMT_NORETURN
unsigned visit_unhandled_arg() {
FMT_THROW(fmt::FormatError("width is not integer"));
return 0
}

Or make some void method?

FMT_NORETURN
void visit_unhandled_arg_noret() {
FMT_THROW(fmt::FormatError("width is not integer"));
}
unsigned visit_unhandled_arg() {
visit_unhandled_arg_noret();
}

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