Enable PRINTF_FORMAT for clang

Because VC++ does not have format-string checking for user-defined
functions during normal compiles, because clang-cl had its format-string
checking disabled, because some files are only compiled on Windows, and
because VC++'s /analyze doesn't build all targets, and because VC++'s
format-string checking is more lenient than clang's... 50 warnings about
format-string mismatches crept in to Chromium's build. Seven of these
were somewhat serious, with four being wchar_t*/char* mismatches because
of base::FilePath and the other three being size_t/%d mismatches.

Now that all of the mismatches are corrected this change enables
PRINTF_FORMAT checking with clang-cl so that these bugs never return.

Bug: 751171
Change-Id: I50ab91cf1c9ba6d122d530fb6cf58f5d84d541a3
Reviewed-on: https://chromium-review.googlesource.com/599127
Reviewed-by: Nico Weber <[email protected]>
Commit-Queue: Bruce Dawson <[email protected]>
Cr-Commit-Position: refs/heads/master@{#492796}
diff --git a/base/compiler_specific.h b/base/compiler_specific.h
index 6389330..7d474f4 100644
--- a/base/compiler_specific.h
+++ b/base/compiler_specific.h
@@ -137,7 +137,7 @@
 // |dots_param| is the one-based index of the "..." parameter.
 // For v*printf functions (which take a va_list), pass 0 for dots_param.
 // (This is undocumented but matches what the system C headers do.)
-#if defined(COMPILER_GCC)
+#if defined(COMPILER_GCC) || defined(__clang__)
 #define PRINTF_FORMAT(format_param, dots_param) \
     __attribute__((format(printf, format_param, dots_param)))
 #else