linmaogithub / pdfium

Automatically exported from code.google.com/p/pdfium
0 stars 0 forks source link

Woverloaded-virtual fires on code in pdfium #185

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
In file included from 
..\..\third_party\pdfium\fpdfsdk\src\formfiller\FFL_ListBox.cpp:9:
..\..\third_party\pdfium\fpdfsdk\src\formfiller/../../include/formfiller/FFL_Lis
tBox.h(44,18) :  error(clang): 'CFFL_ListBox::OnKeyStroke' hides overloaded 
virtual function [-Werror,-Woverloaded-virtual]
    virtual void OnKeyStroke(FX_BOOL bKeyDown, FX_DWORD nFlag);
                 ^
..\..\third_party\pdfium\fpdfsdk\src\formfiller/../../include/formfiller/FFL_For
mFiller.h(94,18) :  note(clang): hidden overloaded virtual function 
'CFFL_FormFiller::OnKeyStroke' declared here: different number of parameters (1 
vs 2)
        virtual void                            OnKeyStroke(FX_BOOL bKeyDown);
                                                ^
1 error generated.
clang-cl.exe:error: falling back to 
E:\b\depot_tools\win_toolchain\vs2013_files\win8sdk\bin\..\..\VC\bin\amd64_x86\c
l.exe
[363/26227] CC 
obj\third_party\pdfium\third_party\lcms2-2.6\src\fx_lcms2.cmscgats.obj
In file included from 
..\..\third_party\pdfium\fpdfsdk\src\formfiller\FFL_ComboBox.cpp:11:
..\..\third_party\pdfium\fpdfsdk\src\formfiller/../../include/formfiller/FFL_Com
boBox.h(46,18) :  error(clang): 'CFFL_ComboBox::OnKeyStroke' hides overloaded 
virtual function [-Werror,-Woverloaded-virtual]
        virtual void                            OnKeyStroke(FX_BOOL bKeyDown, FX_UINT nFlag);
                                                ^
..\..\third_party\pdfium\fpdfsdk\src\formfiller/../../include/formfiller/FFL_For
mFiller.h(94,18) :  note(clang): hidden overloaded virtual function 
'CFFL_FormFiller::OnKeyStroke' declared here: different number of parameters (1 
vs 2)
        virtual void                            OnKeyStroke(FX_BOOL bKeyDown);
                                                ^
In file included from 
..\..\third_party\pdfium\fpdfsdk\src\formfiller\FFL_ComboBox.cpp:11:
..\..\third_party\pdfium\fpdfsdk\src\formfiller/../../include/formfiller/FFL_Com
boBox.h(49,18) :  error(clang): 'CFFL_ComboBox::OnSetFocus' hides overloaded 
virtual function [-Werror,-Woverloaded-virtual]
        virtual void                            OnSetFocus(CPWL_Wnd* pWnd);
                                                ^
..\..\third_party\pdfium\fpdfsdk\src\formfiller/../../include/formfiller/FFL_For
mFiller.h(64,21) :  note(clang): hidden overloaded virtual function 
'CFFL_FormFiller::OnSetFocus' declared here: different number of parameters (2 
vs 1)
        virtual FX_BOOL                         OnSetFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag);
                                                ^
In file included from 
..\..\third_party\pdfium\fpdfsdk\src\formfiller\FFL_ComboBox.cpp:11:
..\..\third_party\pdfium\fpdfsdk\src\formfiller/../../include/formfiller/FFL_Com
boBox.h(50,18) :  error(clang): 'CFFL_ComboBox::OnKillFocus' hides overloaded 
virtual function [-Werror,-Woverloaded-virtual]
        virtual void                            OnKillFocus(CPWL_Wnd* pWnd);
                                                ^
..\..\third_party\pdfium\fpdfsdk\src\formfiller/../../include/formfiller/FFL_For
mFiller.h(65,21) :  note(clang): hidden overloaded virtual function 
'CFFL_FormFiller::OnKillFocus' declared here: different number of parameters (2 
vs 1)
        virtual FX_BOOL                         OnKillFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag);
                                                ^
3 errors generated.
..\..\third_party\pdfium\fpdfsdk\src\formfiller/../../include/formfiller/FFL_For
mFiller.h(65,21) :  note(clang): hidden overloaded virtual function 
'CFFL_FormFiller::OnKillFocus' declared here: different number of parameters (2 
vs 1)
        virtual FX_BOOL                         OnKillFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag);
                                                ^
In file included from 
..\..\third_party\pdfium\fpdfsdk\src\formfiller\FFL_IFormFiller.cpp:11:
In file included from 
..\..\third_party\pdfium\fpdfsdk\src\formfiller\FFL_IFormFiller.cpp:14:
..\..\third_party\pdfium\fpdfsdk\src\formfiller/../../include/formfiller/FFL_Tex
tField.h(52,18) :  error(clang): 'CFFL_TextField::OnSetFocus' hides overloaded 
virtual function [-Werror,-Woverloaded-virtual]
        virtual void                            OnSetFocus(CPWL_Wnd* pWnd);
                                                ^
..\..\third_party\pdfium\fpdfsdk\src\formfiller/../../include/formfiller/FFL_For
mFiller.h(64,21) :  note(clang): hidden overloaded virtual function 
'CFFL_FormFiller::OnSetFocus' declared here: different number of parameters (2 
vs 1)
        virtual FX_BOOL                         OnSetFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag);
                                                ^
In file included from 
..\..\third_party\pdfium\fpdfsdk\src\formfiller\FFL_IFormFiller.cpp:14:
..\..\third_party\pdfium\fpdfsdk\src\formfiller/../../include/formfiller/FFL_Tex
tField.h(53,18) :  error(clang): 'CFFL_TextField::OnKillFocus' hides overloaded 
virtual function [-Werror,-Woverloaded-virtual]
        virtual void                            OnKillFocus(CPWL_Wnd* pWnd);
                                                ^
..\..\third_party\pdfium\fpdfsdk\src\formfiller/../../include/formfiller/FFL_For
mFiller.h(65,21) :  note(clang): hidden overloaded virtual function 
'CFFL_FormFiller::OnKillFocus' declared here: different number of parameters (2 
vs 1)
        virtual FX_BOOL                         OnKillFocus(CPDFSDK_Annot* pAnnot, FX_UINT nFlag);
                                                ^

This warning is designed to catch instances where a function used to override a 
virtual function, and then parameters are changed for one of the two functions 
and because of that the override no longer works. From a distance, it looks 
like that's what happened here. If not, so consider renaming one of the two 
setImage / setCompressedImage methods to something else, as it's confusing to 
have a virtual overload that can be overridden and a different override.

Original issue reported on code.google.com by thakis@chromium.org on 21 Jul 2015 at 12:38

GoogleCodeExporter commented 8 years ago

Original comment by thakis@chromium.org on 21 Jul 2015 at 12:39

GoogleCodeExporter commented 8 years ago
I have a CL for this somewhere locally. Building PDFium with Clang here.

Original comment by thestig@chromium.org on 21 Jul 2015 at 12:40

GoogleCodeExporter commented 8 years ago
(Note that you need to either remove -Wno-overloaded-virtual from 
build/common.gypi and build on Win, or add chromium_code: 1 to pdfium.gyp to 
see these warnings locally)

Original comment by thakis@chromium.org on 21 Jul 2015 at 12:44

GoogleCodeExporter commented 8 years ago

Original comment by thakis@chromium.org on 21 Jul 2015 at 12:45

GoogleCodeExporter commented 8 years ago
I believe this is fixed for the main branch, but I need to double check. 
There's more errors on the XFA branch.

Original comment by thestig@chromium.org on 11 Aug 2015 at 8:28

GoogleCodeExporter commented 8 years ago
Let's deal with the XFA branch in another bug. There's a zillion warnings there.

Original comment by thestig@chromium.org on 18 Aug 2015 at 6:35