From e950685455c3b62b167d9b785a8cb5544cb31bba Mon Sep 17 00:00:00 2001 From: Greg Sjaardema Date: Fri, 13 Dec 2019 13:00:20 -0700 Subject: [PATCH] Eliminate unreachable code warnings The code following a `FMT_THROW` is unreachable since the exception does not return. Some compilers (e.g. Nvidia) emit "Unreachable Code" warnings for this construct. Since this is in an include file, the warning can be emitted many many times. --- include/fmt/printf.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/fmt/printf.h b/include/fmt/printf.h index a2fa945d..b8496b1c 100644 --- a/include/fmt/printf.h +++ b/include/fmt/printf.h @@ -46,7 +46,6 @@ class printf_precision_handler { template ::value)> int operator()(T) { FMT_THROW(format_error("precision is not integer")); - return 0; } }; @@ -167,7 +166,6 @@ template class printf_width_handler { template ::value)> unsigned operator()(T) { FMT_THROW(format_error("width is not integer")); - return 0; } };