Require the result of StringPrintf to be used.

When refactoring code it is easy to accidentally disregard the output of
base::StringPrintf. The code will still look superficially correct, and may even
pass code review (as happened with https://codereview.chromium.org/436133002/ ).

This type of bug can be prevented by annotating StringPrintf with
WARN_UNUSED_RESULT. Despite the name, this causes a compile error in our build
configuration (except on Windows, where it is ignored). This should ensure that
such errors are caught by the CQ if not sooner.

TEST=build all; base_unittests
BUG=400663

Review URL: https://codereview.chromium.org/440013003

Cr-Commit-Position: refs/heads/master@{#288353}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@288353 0039d316-1c4b-4281-b951-d872f2087c98


CrOS-Libchrome-Original-Commit: 36a2733bc727bd697a651ec46a2e093be7605837
1 file changed
tree: e450c095f93c08017ac1c409709fa938dae004e4
  1. base/
  2. build/
  3. components/
  4. dbus/
  5. device/
  6. ipc/
  7. mojo/
  8. testing/
  9. third_party/
  10. ui/