summaryrefslogtreecommitdiff
path: root/third_party/base
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-09-26 16:39:20 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-09-27 15:48:38 +0000
commitc29c16f8cb98f4892dd13b0c7b6b08280687d6b0 (patch)
tree351a719c5fc70a6b555ef21cc64ae7342f59c5ec /third_party/base
parentfe9ea0eff300458314d8a422d064597eb588e25d (diff)
downloadpdfium-c29c16f8cb98f4892dd13b0c7b6b08280687d6b0.tar.xz
Enable PRINTF_FORMAT for clang
This ports https://chromium-review.googlesource.com/c/chromium/src/+/599127 from Chromium to PDFium. 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: pdfium:909 Change-Id: I683592f5015b31b4dd04dfe81e6866389b544efe Reviewed-on: https://pdfium-review.googlesource.com/14834 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'third_party/base')
-rw-r--r--third_party/base/compiler_specific.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/third_party/base/compiler_specific.h b/third_party/base/compiler_specific.h
index 832b95bf5f..3dbd1abb33 100644
--- a/third_party/base/compiler_specific.h
+++ b/third_party/base/compiler_specific.h
@@ -143,7 +143,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