diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2022-04-22 11:21:31 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2022-04-25 16:54:01 -0700 |
commit | e92e48bc791ddafe14be39aae10790b680ddd1f7 (patch) | |
tree | b8ddc406834959eecc251e6efd9c3e754a2421d4 /src | |
parent | 1fbd8c282e2eb293cdcb1f0ff097ff9548be975d (diff) |
XCB: fix GCC 12 warning about uninitialized variable use
GCC is right that symbolsGroup2 could remain uninitialized for some
conditions. So always initialize it.
qxcbkeyboard.cpp:284:48: error: ‘symbolsGroup2’ may be used uninitialized [-Werror=maybe-uninitialized]
Pick-to: 6.2 6.3
Change-Id: If05aeeb7176e4f13af9afffd16e84af7d7806b0d
Reviewed-by: Zhang Hao <543985125@qq.com>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/platforms/xcb/qxcbkeyboard.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforms/xcb/qxcbkeyboard.cpp b/src/plugins/platforms/xcb/qxcbkeyboard.cpp index 48abbbf74c..99870d6f45 100644 --- a/src/plugins/platforms/xcb/qxcbkeyboard.cpp +++ b/src/plugins/platforms/xcb/qxcbkeyboard.cpp @@ -257,7 +257,7 @@ struct xkb_keymap *QXcbKeyboard::keymapFromCore(const KeysymModifierMap &keysymM const int maxGroup1 = 4; // We only support 4 shift states anyway const int maxGroup2 = 2; // Only 3rd and 4th keysym are group 2 xcb_keysym_t symbolsGroup1[maxGroup1]; - xcb_keysym_t symbolsGroup2[maxGroup2]; + xcb_keysym_t symbolsGroup2[maxGroup2] = { XKB_KEY_NoSymbol, XKB_KEY_NoSymbol }; for (int i = 0; i < maxGroup1 + maxGroup2; i++) { xcb_keysym_t sym = i < keysymsPerKeycode ? codeMap[i] : XKB_KEY_NoSymbol; if (mapGroup2ToLevel3) { |