Skip to content

Commit

Permalink
Fixes for some pedantic warnings (#1054)
Browse files Browse the repository at this point in the history
* Fix order of initializers

* Remove unused parameter

* Disable warning "-Wswitch-enum"
  • Loading branch information
riccozzz authored and vitaut committed Feb 23, 2019
1 parent 8af651b commit 327d4b6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions include/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions include/format
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ namespace std {
// Implementation details:
using format_arg = basic_format_arg<basic_format_context>;
basic_format_context(O out, basic_format_args<basic_format_context> args, fmt::internal::locale_ref)
: out_(out), args_(args) {}
: args_(args), out_(out) {}
fmt::internal::error_handler error_handler() const { return {}; }
basic_format_arg<basic_format_context> arg(fmt::basic_string_view<charT>) const {
return {}; // unused: named arguments are not supported yet
Expand Down Expand Up @@ -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<Char> id) {}
void on_arg_id(fmt::basic_string_view<Char>) {}

void on_replacement_field(const Char* p) {
parse_ctx.advance_to(p);
Expand Down

0 comments on commit 327d4b6

Please sign in to comment.