[gnome-software/warn-discarded-qualifiers] build: Drop -Wno-discarded-qualifiers
- From: Phaedrus Leeds <mwleeds src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-software/warn-discarded-qualifiers] build: Drop -Wno-discarded-qualifiers
- Date: Tue, 16 Mar 2021 22:34:02 +0000 (UTC)
commit 012bcbd02c0a59dea72f0dff391c38033f85f48d
Author: Phaedrus Leeds <mwleeds endlessos org>
Date: Tue Mar 16 15:30:48 2021 -0700
build: Drop -Wno-discarded-qualifiers
Bring back -Wdiscarded-qualifiers and make changes accordingly to avoid
warnings. These were silenced in df31c677af because they are sometimes
false positives but it seems worth keeping to catch issues such as:
https://gitlab.gnome.org/GNOME/gnome-software/-/merge_requests/653#note_1060024
lib/gs-app.c | 3 +++
lib/gs-plugin.c | 3 +++
lib/gs-self-test.c | 2 +-
meson.build | 1 -
plugins/fedora-langpacks/gs-plugin-fedora-langpacks.c | 3 +++
plugins/flatpak/gs-flatpak.c | 2 +-
6 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/lib/gs-app.c b/lib/gs-app.c
index cb2549d4c..4fef4ac27 100644
--- a/lib/gs-app.c
+++ b/lib/gs-app.c
@@ -415,6 +415,8 @@ static gchar *
gs_app_kudos_to_string (guint64 kudos)
{
g_autoptr(GPtrArray) array = g_ptr_array_new ();
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdiscarded-qualifiers"
if ((kudos & GS_APP_KUDO_MY_LANGUAGE) > 0)
g_ptr_array_add (array, "my-language");
if ((kudos & GS_APP_KUDO_RECENT_RELEASE) > 0)
@@ -443,6 +445,7 @@ gs_app_kudos_to_string (guint64 kudos)
g_ptr_array_add (array, "sandboxed");
if ((kudos & GS_APP_KUDO_SANDBOXED_SECURE) > 0)
g_ptr_array_add (array, "sandboxed-secure");
+#pragma GCC diagnostic pop
g_ptr_array_add (array, NULL);
return g_strjoinv ("|", (gchar **) array->pdata);
}
diff --git a/lib/gs-plugin.c b/lib/gs-plugin.c
index 06c233987..15397f571 100644
--- a/lib/gs-plugin.c
+++ b/lib/gs-plugin.c
@@ -1873,6 +1873,8 @@ gchar *
gs_plugin_refine_flags_to_string (GsPluginRefineFlags refine_flags)
{
g_autoptr(GPtrArray) cstrs = g_ptr_array_new ();
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdiscarded-qualifiers"
if (refine_flags & GS_PLUGIN_REFINE_FLAGS_USE_HISTORY)
g_ptr_array_add (cstrs, "use-history");
if (refine_flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_LICENSE)
@@ -1933,6 +1935,7 @@ gs_plugin_refine_flags_to_string (GsPluginRefineFlags refine_flags)
g_ptr_array_add (cstrs, "require-kudos");
if (refine_flags & GS_PLUGIN_REFINE_FLAGS_REQUIRE_CONTENT_RATING)
g_ptr_array_add (cstrs, "content-rating");
+#pragma GCC diagnostic pop
if (cstrs->len == 0)
return g_strdup ("none");
g_ptr_array_add (cstrs, NULL);
diff --git a/lib/gs-self-test.c b/lib/gs-self-test.c
index 8c8fee93f..a6a28a568 100644
--- a/lib/gs-self-test.c
+++ b/lib/gs-self-test.c
@@ -588,7 +588,7 @@ gs_app_thread_cb (gpointer data)
static void
gs_app_thread_func (gconstpointer user_data)
{
- GsDebug *debug = GS_DEBUG (user_data);
+ const GsDebug *debug = GS_DEBUG (user_data);
GThread *thread1;
GThread *thread2;
g_autoptr(GsApp) app = gs_app_new ("gimp.desktop");
diff --git a/meson.build b/meson.build
index 27f700b87..c7387c508 100644
--- a/meson.build
+++ b/meson.build
@@ -49,7 +49,6 @@ test_args = [
'-Wmissing-prototypes',
'-Wnested-externs',
'-Werror=nested-externs',
- '-Wno-discarded-qualifiers',
'-Wno-missing-field-initializers',
'-Wno-strict-aliasing',
'-Wno-suggest-attribute=format',
diff --git a/plugins/fedora-langpacks/gs-plugin-fedora-langpacks.c
b/plugins/fedora-langpacks/gs-plugin-fedora-langpacks.c
index 0bbb93615..86b0da9f5 100644
--- a/plugins/fedora-langpacks/gs-plugin-fedora-langpacks.c
+++ b/plugins/fedora-langpacks/gs-plugin-fedora-langpacks.c
@@ -36,10 +36,13 @@ gs_plugin_initialize (GsPlugin *plugin)
* Example: en {en_GB}, pt {pt_BR}, zh {zh_CN, zh_TW}
*/
priv->locale_langpack_map = g_hash_table_new (g_str_hash, g_str_equal);
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdiscarded-qualifiers"
g_hash_table_insert (priv->locale_langpack_map, "en_GB", "langpacks-en_GB");
g_hash_table_insert (priv->locale_langpack_map, "pt_BR", "langpacks-pt_BR");
g_hash_table_insert (priv->locale_langpack_map, "zh_CN", "langpacks-zh_CN");
g_hash_table_insert (priv->locale_langpack_map, "zh_TW", "langpacks-zh_TW");
+#pragma GCC diagnostic pop
}
void
diff --git a/plugins/flatpak/gs-flatpak.c b/plugins/flatpak/gs-flatpak.c
index 981030861..7772cd300 100644
--- a/plugins/flatpak/gs-flatpak.c
+++ b/plugins/flatpak/gs-flatpak.c
@@ -3413,7 +3413,7 @@ gs_flatpak_search (GsFlatpak *self,
split[3],
NULL, NULL);
if (installed_ref == NULL) {
- g_ptr_array_add (silos_to_remove, app_ref);
+ g_ptr_array_add (silos_to_remove, (void *)app_ref);
continue;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]