diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2021-11-10 12:46:49 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2021-11-10 14:36:39 +0100 |
commit | 8e08fb9476c1b13937ac6d1148b7f675a2e327ad (patch) | |
tree | ff688d05dcd0415aa4c9131ea83d225c0eb3364b /libreofficekit | |
parent | 358754cc5d36eaecda7c704d588b33a3fdf7803c (diff) |
Avoid -Werror=maybe-uninitialized
...with recent GCC 12 trunk,
> libreofficekit/qa/gtktiledviewer/gtv-signal-handlers.cxx:194:31: error: ‘unoParam’ may be used uninitialized [-Werror=maybe-uninitialized]
> 194 | gchar* pPath = g_strconcat(unoParam[1], "/", "type", nullptr);
> | ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Change-Id: Ia7ac20ac63b995e8f4a8b4c79447799972639588
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124961
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'libreofficekit')
-rw-r--r-- | libreofficekit/qa/gtktiledviewer/gtv-signal-handlers.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libreofficekit/qa/gtktiledviewer/gtv-signal-handlers.cxx b/libreofficekit/qa/gtktiledviewer/gtv-signal-handlers.cxx index be7cd4445536..e7208e5860a3 100644 --- a/libreofficekit/qa/gtktiledviewer/gtv-signal-handlers.cxx +++ b/libreofficekit/qa/gtktiledviewer/gtv-signal-handlers.cxx @@ -16,6 +16,7 @@ #include <sal/macros.h> +#include <cassert> #include <map> #include <vector> @@ -186,8 +187,9 @@ static void iterateUnoParams(GtkWidget* pWidget, gpointer userdata) GList* pIt = nullptr; guint i = 0; const gchar* unoParam[3]; - for (pIt = pChildren.get(), i = 0; pIt != nullptr && i < 3; pIt = pIt->next, i++) + for (pIt = pChildren.get(), i = 0; i < 3; pIt = pIt->next, i++) { + assert(pIt != nullptr); unoParam[i] = gtk_entry_get_text(GTK_ENTRY(pIt->data)); } |