Closed Bug 1406380 Opened 2 years ago Closed 2 years ago

-Wreorder warnings exposed by MinGW Build

Categories

(Core :: General, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: tjr, Assigned: tjr)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

These warnings are generated when a class declares member sin the order a, b, but they are initialized in the order b, a.

https://stackoverflow.com/questions/1828037/whats-the-point-of-g-wreorder

> /builds/worker/workspace/build/src/gfx/webrender_bindings/RenderD3D11TextureHostOGL.h: In constructor 'mozilla::wr::RenderDXGITextureHostOGL::RenderDXGITextureHostOGL(mozilla::WindowsHandle, mozilla::gfx::SurfaceFormat, mozilla::gfx::IntSize)':
> /builds/worker/workspace/build/src/gfx/webrender_bindings/RenderD3D11TextureHostOGL.h:52:26: warning: 'mozilla::wr::RenderDXGITextureHostOGL::mTextureHandle' will be initialized after [-Wreorder]
>    GLuint mTextureHandle[2];
>                           ^
> /builds/worker/workspace/build/src/gfx/webrender_bindings/RenderD3D11TextureHostOGL.h:47:14: warning:   'void* mozilla::wr::RenderDXGITextureHostOGL::mSurface' [-Wreorder]
>    EGLSurface mSurface;
>               ^~~~~~~~
> In file included from /builds/worker/workspace/build/src/obj-firefox/gfx/webrender_bindings/Unified_cpp_webrender_bindings0.cpp:20:0:
> /builds/worker/workspace/build/src/gfx/webrender_bindings/RenderD3D11TextureHostOGL.cpp:39:1: warning:   when initialized here [-Wreorder]
>  RenderDXGITextureHostOGL::RenderDXGITextureHostOGL(WindowsHandle aHandle,
>  ^~~~~~~~~~~~~~~~~~~~~~~~


> In file included from /builds/worker/workspace/build/src/obj-firefox/dom/gamepad/Unified_cpp_dom_gamepad0.cpp:110:0:
> /builds/worker/workspace/build/src/dom/gamepad/windows/WindowsGamepad.cpp: In constructor '{anonymous}::Gamepad::Gamepad(uint32_t, uint32_t, bool, {anonymous}::GamepadType)':
> /builds/worker/workspace/build/src/dom/gamepad/windows/WindowsGamepad.cpp:125:8: warning: '{anonymous}::Gamepad::hasDpad' will be initialized after [-Wreorder]
>    bool hasDpad;
>         ^~~~~~~
> /builds/worker/workspace/build/src/dom/gamepad/windows/WindowsGamepad.cpp:106:15: warning:   '{anonymous}::GamepadType {anonymous}::Gamepad::type' [-Wreorder]
>    GamepadType type;
>                ^~~~
> /builds/worker/workspace/build/src/dom/gamepad/windows/WindowsGamepad.cpp:138:3: warning:   when initialized here [-Wreorder]
>    Gamepad(uint32_t aNumAxes,
>    ^~~~~~~
> /builds/worker/workspace/build/src/dom/gamepad/windows/WindowsGamepad.cpp: In constructor '{anonymous}::XInputLoader::XInputLoader()':
> /builds/worker/workspace/build/src/dom/gamepad/windows/WindowsGamepad.cpp:201:21: warning: '{anonymous}::XInputLoader::mXInputEnable' will be initialized after [-Wreorder]
>    XInputEnable_func mXInputEnable;
>                      ^~~~~~~~~~~~~
> /builds/worker/workspace/build/src/dom/gamepad/windows/WindowsGamepad.cpp:200:29: warning:   'DWORD (__attribute__((__stdcall__)) * {anonymous}::XInputLoader::mXInputGetState)(DWORD, XINPUT_STATE*)' [-Wreorder]
>    decltype(XInputGetState) *mXInputGetState;
>                              ^~~~~~~~~~~~~~~
> /builds/worker/workspace/build/src/dom/gamepad/windows/WindowsGamepad.cpp:161:3: warning:   when initialized here [-Wreorder]
>    XInputLoader() : module(nullptr),
>    ^~~~~~~~~~~~
> In file included from /builds/worker/workspace/build/src/obj-firefox/dom/gamepad/Unified_cpp_dom_gamepad0.cpp:110:0:
> /builds/worker/workspace/build/src/dom/gamepad/windows/WindowsGamepad.cpp: In constructor '{anonymous}::HIDLoader::HIDLoader()':
> /builds/worker/workspace/build/src/dom/gamepad/windows/WindowsGamepad.cpp:329:11: warning: '{anonymous}::HIDLoader::mModule' will be initialized after [-Wreorder]
>    HMODULE mModule;
>            ^~~~~~~
> /builds/worker/workspace/build/src/dom/gamepad/windows/WindowsGamepad.cpp:320:36: warning:   'BOOLEAN (__attribute__((__stdcall__)) * {anonymous}::HIDLoader::mHidD_GetProductString)(HANDLE, PVOID, ULONG)' [-Wreorder]
>    decltype(HidD_GetProductString) *mHidD_GetProductString;
>                                     ^~~~~~~~~~~~~~~~~~~~~~
> In file included from /builds/worker/workspace/build/src/obj-firefox/dom/gamepad/Unified_cpp_dom_gamepad0.cpp:110:0:
> /builds/worker/workspace/build/src/dom/gamepad/windows/WindowsGamepad.cpp:283:3: warning:   when initialized here [-Wreorder]
>    HIDLoader() : mModule(LoadLibraryW(L"hid.dll")),
>    ^~~~~~~~~


> In file included from /builds/worker/workspace/build/src/dom/media/platforms/wmf/WMFDecoderModule.cpp:17:0,
>                  from /builds/worker/workspace/build/src/obj-firefox/dom/media/platforms/wmf/Unified_cpp_media_platforms_wmf0.cpp:29:
> /builds/worker/workspace/build/src/dom/media/platforms/wmf/WMFVideoMFTManager.h: In constructor 'mozilla::WMFVideoMFTManager::WMFVideoMFTManager(const mozilla::VideoInfo&, mozilla::layers::KnowsCompositor*, mozilla::layers::ImageContainer*, float, bool)':
> /builds/worker/workspace/build/src/dom/media/platforms/wmf/WMFVideoMFTManager.h:102:0: warning: 'mozilla::WMFVideoMFTManager::mDXVAEnabled' will be initialized after [-Wreorder]
>    bool mDXVAEnabled;
> /builds/worker/workspace/build/src/dom/media/platforms/wmf/WMFVideoMFTManager.h:94:0: warning:   'RefPtr<mozilla::layers::KnowsCompositor> mozilla::WMFVideoMFTManager::mKnowsCompositor' [-Wreorder]
>    RefPtr<layers::KnowsCompositor> mKnowsCompositor;
> In file included from /builds/worker/workspace/build/src/obj-firefox/dom/media/platforms/wmf/Unified_cpp_media_platforms_wmf0.cpp:47:0:
> /builds/worker/workspace/build/src/dom/media/platforms/wmf/WMFVideoMFTManager.cpp:166:0: warning:   when initialized here [-Wreorder]
>  WMFVideoMFTManager::WMFVideoMFTManager(



> /builds/worker/workspace/build/src/dom/plugins/ipc/PluginModuleChild.cpp: In constructor 'GetKeyStateTask::GetKeyStateTask(int, HANDLE, SHORT*)':
> /builds/worker/workspace/build/src/dom/plugins/ipc/PluginModuleChild.cpp:1973:12: warning: 'GetKeyStateTask::mSemaphore' will be initialized after [-Wreorder]
>      HANDLE mSemaphore;
>             ^~~~~~~~~~
> /builds/worker/workspace/build/src/dom/plugins/ipc/PluginModuleChild.cpp:1971:12: warning:   'SHORT* GetKeyStateTask::mKeyState' [-Wreorder]
>      SHORT* mKeyState;
>             ^~~~~~~~~
> /builds/worker/workspace/build/src/dom/plugins/ipc/PluginModuleChild.cpp:1976:14: warning:   when initialized here [-Wreorder]
>      explicit GetKeyStateTask(int aVirtKey, HANDLE aSemaphore, SHORT* aKeyState) :
>               ^~~~~~~~~~~~~~~
> /builds/worker/workspace/build/src/dom/plugins/ipc/PluginModuleChild.cpp: In constructor 'PluginThreadTask::PluginThreadTask(PluginThreadTaskData*, HANDLE)':
> /builds/worker/workspace/build/src/dom/plugins/ipc/PluginModuleChild.cpp:2047:12: warning: 'PluginThreadTask::mSemaphore' will be initialized after [-Wreorder]
>      HANDLE mSemaphore;
>             ^~~~~~~~~~
> /builds/worker/workspace/build/src/dom/plugins/ipc/PluginModuleChild.cpp:2045:10: warning:   'bool PluginThreadTask::mSuccess' [-Wreorder]
>      bool mSuccess;
>           ^~~~~~~~
> /builds/worker/workspace/build/src/dom/plugins/ipc/PluginModuleChild.cpp:2050:14: warning:   when initialized here [-Wreorder]
>      explicit PluginThreadTask(PluginThreadTaskData* aTaskData,
>               ^~~~~~~~~~~~~~~~



> In file included from /builds/worker/workspace/build/src/obj-firefox/dom/plugins/ipc/Unified_cpp_dom_plugins_ipc0.cpp:137:0:
> /builds/worker/workspace/build/src/dom/plugins/ipc/PluginUtilsWin.cpp: In constructor 'mozilla::plugins::PluginUtilsWin::AudioNotification::AudioNotification()':
> /builds/worker/workspace/build/src/dom/plugins/ipc/PluginUtilsWin.cpp:192:0: warning: 'mozilla::plugins::PluginUtilsWin::AudioNotification::mRefCt' will be initialized after [-Wreorder]
>    LONG mRefCt;
> /builds/worker/workspace/build/src/dom/plugins/ipc/PluginUtilsWin.cpp:191:0: warning:   'bool mozilla::plugins::PluginUtilsWin::AudioNotification::mIsRegistered' [-Wreorder]
>    bool mIsRegistered;   // only used to make sure that Unregister is called before destroying a Valid instance.
> In file included from /builds/worker/workspace/build/src/obj-firefox/dom/plugins/ipc/Unified_cpp_dom_plugins_ipc0.cpp:137:0:
> /builds/worker/workspace/build/src/dom/plugins/ipc/PluginUtilsWin.cpp:51:0: warning:   when initialized here [-Wreorder]
>    AudioNotification() :



> In file included from /builds/worker/workspace/build/src/widget/windows/PDFViaEMFPrintHelper.h:10:0,
>                  from /builds/worker/workspace/build/src/widget/windows/PDFViaEMFPrintHelper.cpp:6,
>                  from /builds/worker/workspace/build/src/obj-firefox/widget/windows/Unified_cpp_widget_windows0.cpp:92:
> /builds/worker/workspace/build/src/widget/windows/PDFiumEngineShim.h: In constructor 'mozilla::widget::PDFiumEngineShim::PDFiumEngineShim()':
> /builds/worker/workspace/build/src/widget/windows/PDFiumEngineShim.h:86:0: warning: 'mozilla::widget::PDFiumEngineShim::mPRLibrary' will be initialized after [-Wreorder]
>    PRLibrary*  mPRLibrary;
> /builds/worker/workspace/build/src/widget/windows/PDFiumEngineShim.h:75:0: warning:   'bool mozilla::widget::PDFiumEngineShim::mInitialized' [-Wreorder]
>    bool        mInitialized ;
> In file included from /builds/worker/workspace/build/src/obj-firefox/widget/windows/Unified_cpp_widget_windows0.cpp:101:0:
> /builds/worker/workspace/build/src/widget/windows/PDFiumEngineShim.cpp:42:0: warning:   when initialized here [-Wreorder]
>  PDFiumEngineShim::PDFiumEngineShim()



> In file included from /builds/worker/workspace/build/src/widget/windows/WindowsEMF.cpp:6:0,
>                  from /builds/worker/workspace/build/src/obj-firefox/widget/windows/Unified_cpp_widget_windows1.cpp:74:
> /builds/worker/workspace/build/src/widget/windows/WindowsEMF.h: In constructor 'mozilla::widget::WindowsEMF::WindowsEMF()':
> /builds/worker/workspace/build/src/widget/windows/WindowsEMF.h:82:0: warning: 'mozilla::widget::WindowsEMF::mDC' will be initialized after [-Wreorder]
>    HDC mDC;
> /builds/worker/workspace/build/src/widget/windows/WindowsEMF.h:81:0: warning:   'HENHMETAFILE__* mozilla::widget::WindowsEMF::mEmf' [-Wreorder]
>    HENHMETAFILE mEmf;
> In file included from /builds/worker/workspace/build/src/obj-firefox/widget/windows/Unified_cpp_widget_windows1.cpp:74:0:
> /builds/worker/workspace/build/src/widget/windows/WindowsEMF.cpp:12:0: warning:   when initialized here [-Wreorder]
>  WindowsEMF::WindowsEMF()
Comment on attachment 8915977 [details]
Bug 1406380 Fix -Wreorder warnings

https://reviewboard.mozilla.org/r/187266/#review192606

::: dom/plugins/ipc/PluginModuleChild.cpp:2053
(Diff revision 3)
>  
>  public:
>      explicit PluginThreadTask(PluginThreadTaskData* aTaskData,
>                                HANDLE aSemaphore) :
> -        Runnable("PluginThreadTask"), mTaskData(aTaskData),
> -        mSemaphore(aSemaphore), mSuccess(false)
> +        Runnable("PluginThreadTask"), mSuccess(false),
> +        mTaskData(aTaskData), mSemaphore(aSemaphore)

While you're here you might as well put each field on its own line, because that's standard.
Attachment #8915977 - Flags: review?(n.nethercote) → review+
Keywords: checkin-needed
Tom, bravo for this work. You should ask for permissions to autoland from mozreview btw ;)
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/224eccf80d47
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
Duplicate of this bug: 1298144
You need to log in before you can comment on or make changes to this bug.