From 175bedf920159f75b2d517fd638835569477aa55 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Tue, 19 May 2020 13:17:50 +0200 Subject: [PATCH] xmm: avoid cast-align errors We can safely cast the data in a GArray to gpointer first, and then to the pointer type we require. xmm/mm-shared-xmm.c: In function 'validate_and_build_command_set_current_bands': xmm/mm-shared-xmm.c:512:45: error: cast increases required alignment of target type [-Werror=cast-align] str = mm_common_build_bands_string ((const MMModemBand *)unapplied_bands->data, unapplied_bands->len); ^ --- plugins/xmm/mm-shared-xmm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/xmm/mm-shared-xmm.c b/plugins/xmm/mm-shared-xmm.c index 60457589..746aff36 100644 --- a/plugins/xmm/mm-shared-xmm.c +++ b/plugins/xmm/mm-shared-xmm.c @@ -509,7 +509,7 @@ validate_and_build_command_set_current_bands (MMSharedXmm *self, if (unapplied_bands->len > 0) { gchar *str; - str = mm_common_build_bands_string ((const MMModemBand *)unapplied_bands->data, unapplied_bands->len); + str = mm_common_build_bands_string ((const MMModemBand *)(gconstpointer)unapplied_bands->data, unapplied_bands->len); inner_error = g_error_new (MM_CORE_ERROR, MM_CORE_ERROR_INVALID_ARGS, "Cannot update bands for modes not currently allowed: %s", str); g_free (str);