Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(209)

Issue 1921323002: Fix Wvarargs warning in XFA error code. (Closed)

Created:
4 years, 8 months ago by dsinclair
Modified:
4 years, 8 months ago
Reviewers:
Tom Sepez, Lei Zhang, Nico
CC:
pdfium-reviews_googlegroups.com
Base URL:
https://pdfium.googlesource.com/pdfium.git@master
Target Ref:
refs/heads/master
Project:
pdfium
Visibility:
Public.

Description

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 Committed: https://pdfium.googlesource.com/pdfium/+/76c53794b6202ec37f6dcace5f2ae86870e953b6

Patch Set 1 #

Total comments: 6

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+65 lines, -73 lines) Patch
M DEPS View 2 chunks +3 lines, -3 lines 0 comments Download
M build_gyp/standalone.gypi View 1 chunk +4 lines, -1 line 0 comments Download
M build_overrides/v8.gni View 1 chunk +1 line, -0 lines 0 comments Download
M xfa/fxfa/fm2js/xfa_error.h View 1 2 chunks +7 lines, -13 lines 0 comments Download
D xfa/fxfa/fm2js/xfa_error.cpp View 1 1 chunk +9 lines, -13 lines 0 comments Download
M xfa/fxfa/fm2js/xfa_fmparse.h View 1 chunk +1 line, -1 line 0 comments Download
M xfa/fxfa/fm2js/xfa_fmparse.cpp View 1 21 chunks +24 lines, -25 lines 0 comments Download
M xfa/fxfa/fm2js/xfa_lexer.h View 1 chunk +1 line, -1 line 0 comments Download
M xfa/fxfa/fm2js/xfa_lexer.cpp View 1 13 chunks +15 lines, -16 lines 0 comments Download

Messages

Total messages: 14 (4 generated)
dsinclair
PTAL. In order to get a clang with -Wvararg I had to update //build. That ...
4 years, 8 months ago (2016-04-26 15:39:40 UTC) #2
Nico
lgtm I don't understand why we didn't see this on Chromium's waterfall though -- are ...
4 years, 8 months ago (2016-04-26 15:45:20 UTC) #3
Tom Sepez
https://codereview.chromium.org/1921323002/diff/1/xfa/fxfa/fm2js/xfa_error.h File xfa/fxfa/fm2js/xfa_error.h (left): https://codereview.chromium.org/1921323002/diff/1/xfa/fxfa/fm2js/xfa_error.h#oldcode12 xfa/fxfa/fm2js/xfa_error.h:12: what if you did enum XFA_FM_ERRMSG : uint32_t { ...
4 years, 8 months ago (2016-04-26 15:51:04 UTC) #4
dsinclair
On 2016/04/26 15:45:20, Nico wrote: > lgtm > > I don't understand why we didn't ...
4 years, 8 months ago (2016-04-26 15:54:26 UTC) #5
dsinclair
https://codereview.chromium.org/1921323002/diff/1/xfa/fxfa/fm2js/xfa_error.h File xfa/fxfa/fm2js/xfa_error.h (left): https://codereview.chromium.org/1921323002/diff/1/xfa/fxfa/fm2js/xfa_error.h#oldcode12 xfa/fxfa/fm2js/xfa_error.h:12: On 2016/04/26 15:51:04, Tom Sepez wrote: > what if ...
4 years, 8 months ago (2016-04-26 15:57:39 UTC) #6
Tom Sepez
https://codereview.chromium.org/1921323002/diff/1/xfa/fxfa/fm2js/xfa_error.cpp File xfa/fxfa/fm2js/xfa_error.cpp (left): https://codereview.chromium.org/1921323002/diff/1/xfa/fxfa/fm2js/xfa_error.cpp#oldcode9 xfa/fxfa/fm2js/xfa_error.cpp:9: static const FX_WCHAR* const gs_lpStrErrorMsgInfo[] = { Then this ...
4 years, 8 months ago (2016-04-26 16:03:58 UTC) #7
dsinclair
https://codereview.chromium.org/1921323002/diff/1/xfa/fxfa/fm2js/xfa_error.cpp File xfa/fxfa/fm2js/xfa_error.cpp (left): https://codereview.chromium.org/1921323002/diff/1/xfa/fxfa/fm2js/xfa_error.cpp#oldcode9 xfa/fxfa/fm2js/xfa_error.cpp:9: static const FX_WCHAR* const gs_lpStrErrorMsgInfo[] = { On 2016/04/26 ...
4 years, 8 months ago (2016-04-26 16:36:46 UTC) #8
Tom Sepez
lgtm
4 years, 8 months ago (2016-04-26 17:58:28 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1921323002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1921323002/20001
4 years, 8 months ago (2016-04-26 18:05:11 UTC) #12
commit-bot: I haz the power
4 years, 8 months ago (2016-04-26 18:05:32 UTC) #14
Message was sent while issue was closed.
Committed patchset #2 (id:20001) as
https://pdfium.googlesource.com/pdfium/+/76c53794b6202ec37f6dcace5f2ae86870e9...

Powered by Google App Engine
This is Rietveld 408576698