Skip to content
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

compilation error on msvc with FMT_EXCEPTIONS=0 #144

Closed
sbrednikhin opened this issue Mar 25, 2015 · 1 comment
Closed

compilation error on msvc with FMT_EXCEPTIONS=0 #144

sbrednikhin opened this issue Mar 25, 2015 · 1 comment

Comments

@sbrednikhin
Copy link

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();
}

@vitaut
Copy link
Contributor

vitaut commented Mar 25, 2015

Should be fixed in 6691578. Thanks for reporting!

@vitaut vitaut closed this as completed Mar 25, 2015
CarterLi added a commit to CarterLi/cppformat that referenced this issue Mar 26, 2015
Wraps __assume(0) to a noreturn function to silence MSVC errors.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants