Commit 33b98b07 authored by Michael Catanzaro's avatar Michael Catanzaro

Reenable and placate -Wformat-nonliteral

parent 96ddfffc
......@@ -38,7 +38,7 @@ AX_COMPILER_FLAGS([WARN_CFLAGS], [WARN_LDFLAGS], [$ax_is_release], [-Wdeclaratio
dnl TODO: Remove all of these! These warnings should be fixed, not
dnl silenced. At least, for the most part. -Wswitch-enum really does
dnl seem pretty dumb.
[-Wno-shadow -Wno-format-nonliteral -Wno-deprecated-declarations -Wno-switch-enum -Wno-switch-default -Wno-redundant-decls -Wno-discarded-qualifiers -Wno-sign-compare])
[-Wno-shadow -Wno-deprecated-declarations -Wno-switch-enum -Wno-switch-default -Wno-redundant-decls -Wno-discarded-qualifiers -Wno-sign-compare])
AC_PROG_CC
......
......@@ -242,8 +242,12 @@ ephy_embed_utils_autosearch_address (const char *search_key)
}
query_param = soup_form_encode ("q", search_key, NULL);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
/* Format string under control of user input... but gsettings is trusted input. */
/* + 2 here is getting rid of 'q=' */
effective_address = g_strdup_printf (url_search, query_param + 2);
#pragma GCC diagnostic pop
g_free (query_param);
g_free (url_search);
......
......@@ -65,7 +65,6 @@ struct _EphyEmbed {
GtkWidget *floating_bar;
GtkWidget *progress;
GtkWidget *fullscreen_message_label;
char *fullscreen_string;
char *title;
WebKitURIRequest *delayed_request;
......@@ -416,7 +415,6 @@ ephy_embed_finalize (GObject *object)
g_slist_free (embed->keys);
embed->keys = NULL;
g_free (embed->fullscreen_string);
g_free (embed->title);
G_OBJECT_CLASS (ephy_embed_parent_class)->finalize (object);
......@@ -529,11 +527,8 @@ ephy_embed_set_fullscreen_message (EphyEmbed *embed,
{
char *message;
if (G_UNLIKELY (embed->fullscreen_string == NULL))
embed->fullscreen_string = g_strdup (_("Press %s to exit fullscreen"));
/* Translators: 'ESC' and 'F11' are keyboard keys. */
message = g_strdup_printf (embed->fullscreen_string, is_html5_fullscreen ? _("ESC") : _("F11"));
message = g_strdup_printf (_("Press %s to exit fullscreen"), is_html5_fullscreen ? _("ESC") : _("F11"));
gtk_label_set_text (GTK_LABEL (embed->fullscreen_message_label),
message);
g_free (message);
......
......@@ -1906,6 +1906,9 @@ ephy_web_view_load_error_page (EphyWebView *view,
if (load_anyway_js == NULL)
load_anyway_js = g_strdup_printf ("window.location = '%s';", uri);
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
/* The HTML file is trusted input. */
g_string_printf (html,
g_bytes_get_data (html_file, NULL),
lang, lang,
......@@ -1915,6 +1918,7 @@ ephy_web_view_load_error_page (EphyWebView *view,
load_anyway_js,
custom_class,
msg_title, msg, button_label);
#pragma GCC diagnostic pop
g_bytes_unref (html_file);
g_free (stylesheet);
......
......@@ -60,7 +60,7 @@ static void
set_error_from_string (const char* string, GError **error)
{
if (error)
*error = g_error_new (get_ephy_sqlite_quark (), 0, string, 0);
*error = g_error_new_literal (get_ephy_sqlite_quark (), 0, string);
}
EphySQLiteConnection *
......@@ -102,7 +102,7 @@ void
ephy_sqlite_connection_get_error (EphySQLiteConnection *self, GError **error)
{
if (error)
*error = g_error_new (get_ephy_sqlite_quark (), 0, sqlite3_errmsg (self->priv->database), 0);
*error = g_error_new_literal (get_ephy_sqlite_quark (), 0, sqlite3_errmsg (self->priv->database));
}
gboolean
......
......@@ -150,8 +150,12 @@ eel_strdup_strftime (const char *format, struct tm *time_pieces)
}
code[i++] = *remainder;
code[i++] = '\0';
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wformat-nonliteral"
/* Format string under control of caller, since this is a wrapper for strftime. */
string_length = strftime (buffer, sizeof (buffer),
code, time_pieces);
#pragma GCC diagnostic pop
if (string_length == 0) {
/* We could put a warning here, but there's no
* way to tell a successful conversion to
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment