From 327d4b6e9e1225b3e7a68ed4d47c7af40ad89e53 Mon Sep 17 00:00:00 2001 From: Brian Date: Sat, 23 Feb 2019 14:40:08 -0500 Subject: [PATCH] Fixes for some pedantic warnings (#1054) * Fix order of initializers * Remove unused parameter * Disable warning "-Wswitch-enum" --- include/fmt/format.h | 4 ++++ include/format | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index 3bcc811b..3139c43d 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -62,6 +62,10 @@ #if FMT_GCC_VERSION >= 406 || FMT_CLANG_VERSION # pragma GCC diagnostic push +// Disable warning about not handling all enums in switch statement even with +// a default case +# pragma GCC diagnostic ignored "-Wswitch-enum" + // Disable the warning about declaration shadowing because it affects too // many valid cases. # pragma GCC diagnostic ignored "-Wshadow" diff --git a/include/format b/include/format index 27dadbec..1ee6b838 100644 --- a/include/format +++ b/include/format @@ -209,7 +209,7 @@ namespace std { // Implementation details: using format_arg = basic_format_arg; basic_format_context(O out, basic_format_args args, fmt::internal::locale_ref) - : out_(out), args_(args) {} + : args_(args), out_(out) {} fmt::internal::error_handler error_handler() const { return {}; } basic_format_arg arg(fmt::basic_string_view) const { return {}; // unused: named arguments are not supported yet @@ -570,7 +570,7 @@ struct format_handler : fmt::internal::error_handler { parse_ctx.check_arg_id(id); arg = context.arg(id); } - void on_arg_id(fmt::basic_string_view id) {} + void on_arg_id(fmt::basic_string_view) {} void on_replacement_field(const Char* p) { parse_ctx.advance_to(p);