libreofficekit/qa/gtktiledviewer/gtv-signal-handlers.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
New commits: commit 8e08fb9476c1b13937ac6d1148b7f675a2e327ad Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Wed Nov 10 12:46:49 2021 +0100 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Wed Nov 10 14:36:39 2021 +0100 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 <sberg...@redhat.com> 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)); }