From: Orvid King Date: Mon, 14 Sep 2015 17:54:21 +0000 (-0700) Subject: Don't use weird format specifiers X-Git-Tag: deprecate-dynamic-initializer~410 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=abece752484ae7fbfc4edfa1e10d52f86d07f3fe;p=folly.git Don't use weird format specifiers Summary: MSVC doesn't like it when you use `%1$s`, and actually emits a warning at compile time, so pass the second arugment twice instead. Closes https://github.com/facebook/folly/pull/302 Reviewed By: @yfeldblum Differential Revision: D2371262 Pulled By: @JoelMarcey --- diff --git a/folly/experimental/NestedCommandLineApp.cpp b/folly/experimental/NestedCommandLineApp.cpp index 3b37990e..c0499a6e 100644 --- a/folly/experimental/NestedCommandLineApp.cpp +++ b/folly/experimental/NestedCommandLineApp.cpp @@ -130,8 +130,8 @@ void NestedCommandLineApp::displayHelp( // Help for a given command auto& p = findCommand(args.front()); if (p.first != args.front()) { - printf("`%1$s' is an alias for `%2$s'; showing help for `%2$s'\n", - args.front().c_str(), p.first.c_str()); + printf("`%s' is an alias for `%s'; showing help for `%s'\n", + args.front().c_str(), p.first.c_str(), p.first.c_str()); } auto& info = p.second;