Simplify ALLOW_UNUSED_LOCAL to use (void)x directly instead of conditionally.

Add ALLOW_UNUSED_LOCAL implementation for path-sensitive analyzers.
The current definition of ALLOW_UNUSED_LOCAL uses "(void)x" to suppress
warnings that "x" was never used, but places the expression in a
never-executed codepath of a ternary expression, forcing this
statement to be a no-op.

Static analyzers which are codepath sensitive, like Clang's scan-build,
will only trace along the no-op codepath and therefore will never
evaluate the voidification clause. The result is a lot of warning noise
like this:

"warning: Value stored to 'x' during its initialization is never read"

This CL removes the ternary expression from ALLOW_UNUSED_LOCAL so that the voidification statement is evaluated by path sensitive checkers. The build size was not affected by this change, therefore it's reasonable to assume that this won't have an effect on runtime behavior.

R=pkasting@chromium.org
CC=wez@chromium.org
BUG=687243

Review-Url: https://codereview.chromium.org/2838713002
Cr-Commit-Position: refs/heads/master@{#467215}
diff --git a/base/compiler_specific.h b/base/compiler_specific.h
index 0f4c058..34b0c2d 100644
--- a/base/compiler_specific.h
+++ b/base/compiler_specific.h
@@ -71,14 +71,13 @@
 
 #endif  // COMPILER_MSVC
 
-
 // Annotate a variable indicating it's ok if the variable is not used.
 // (Typically used to silence a compiler warning when the assignment
 // is important for some other reason.)
 // Use like:
 //   int x = ...;
 //   ALLOW_UNUSED_LOCAL(x);
-#define ALLOW_UNUSED_LOCAL(x) false ? (void)x : (void)0
+#define ALLOW_UNUSED_LOCAL(x) (void)x
 
 // Annotate a typedef or function indicating it's ok if it's not used.
 // Use like: