DescriptionRequire 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
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=288353
Patch Set 1 #
Messages
Total messages: 8 (0 generated)
|