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
Showing
Please register or sign in to comment