From 76c53794b6202ec37f6dcace5f2ae86870e953b6 Mon Sep 17 00:00:00 2001 From: dsinclair Date: Tue, 26 Apr 2016 11:05:26 -0700 Subject: Fix Wvarargs warning in XFA error code. Chrome has enabled the -Wvarargs warning that was added to clang, this fails with PDFium XFA builds due to two warnings: ../../xfa/fxfa/fm2js/xfa_lexer.cpp:539:16: error: passing an object that undergoes default argument promotion to 'va_start' has undefined behavior [-Werror,-Wvarargs] va_start(ap, msg); ^ ../../xfa/fxfa/fm2js/xfa_lexer.cpp:535:40: note: parameter of type 'XFA_FM_ERRMSG' is declared here void CXFA_FMLexer::Error(XFA_FM_ERRMSG msg, ...) { The issue is that XFA_FM_ERRMSG is an enum and we violate the promotion rules for passing the value to va_start. I removed the enum and named the flags explicitly then pass in the string as the argument. BUG=chromium:606726 Review URL: https://codereview.chromium.org/1921323002 --- build_gyp/standalone.gypi | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'build_gyp/standalone.gypi') diff --git a/build_gyp/standalone.gypi b/build_gyp/standalone.gypi index 4b5b74072a..ad7ebdaac0 100644 --- a/build_gyp/standalone.gypi +++ b/build_gyp/standalone.gypi @@ -394,7 +394,10 @@ ], }, 'variables': { - 'clang_warning_flags': [], + 'clang_warning_flags': [ + # TODO(thakis): https://crbug.com/604888 + '-Wno-undefined-var-template', + ], }, 'includes': [ 'set_clang_warning_flags.gypi', ], 'conditions': [ -- cgit v1.2.3