summaryrefslogtreecommitdiff
path: root/xfa/fxfa/fm2js/xfa_fmparse.h
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-04-26 11:05:26 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-26 11:05:26 -0700
commit76c53794b6202ec37f6dcace5f2ae86870e953b6 (patch)
treeb7c9fce179cee0be2ac01ff966e6521169831e03 /xfa/fxfa/fm2js/xfa_fmparse.h
parent186a78eb0a821a2f1feef524cb590d0fea2009ba (diff)
downloadpdfium-chromium/2719.tar.xz
Fix Wvarargs warning in XFA error code.chromium/2722chromium/2721chromium/2719chromium/2718
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
Diffstat (limited to 'xfa/fxfa/fm2js/xfa_fmparse.h')
-rw-r--r--xfa/fxfa/fm2js/xfa_fmparse.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/xfa/fxfa/fm2js/xfa_fmparse.h b/xfa/fxfa/fm2js/xfa_fmparse.h
index 288ae90744..014eccee08 100644
--- a/xfa/fxfa/fm2js/xfa_fmparse.h
+++ b/xfa/fxfa/fm2js/xfa_fmparse.h
@@ -18,7 +18,7 @@ class CXFA_FMParse {
int32_t Init(const CFX_WideStringC& wsFormcalc, CXFA_FMErrorInfo* pErrorInfo);
void NextToken();
void Check(XFA_FM_TOKEN op);
- void Error(uint32_t lineNum, XFA_FM_ERRMSG msg, ...);
+ void Error(uint32_t lineNum, const FX_WCHAR* msg, ...);
CFX_PtrArray* ParseTopExpression();
CXFA_FMExpression* ParseFunction();
CXFA_FMExpression* ParseExpression();