[ghex] unbreak build with gcc 4 after 1f39eeff



commit 5e933cabf5efe2aa6609e0f6d0a86d976ccc08a1
Author: Jasper Lievisse Adriaanse <jasper humppa nl>
Date:   Tue Jun 14 10:02:34 2016 +0200

    unbreak build with gcc 4 after 1f39eeff
    
    fixes #767638

 src/chartable.c   |    4 ++++
 src/ghex-window.c |    4 ++++
 src/ui.c          |    4 ++++
 3 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/src/chartable.c b/src/chartable.c
index 371526c..9306b40 100644
--- a/src/chartable.c
+++ b/src/chartable.c
@@ -186,10 +186,14 @@ GtkWidget *create_char_table()
                else
                        row[0] = "";
                for(col = 1; col < 4; col++) {
+#if defined(__GNUC__) && (__GNUC__ > 4)
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wformat-nonliteral"
+#endif
                        label = g_strdup_printf(fmt[col], i);
+#if defined(__GNUC__) && (__GNUC__ > 4)
 #pragma GCC diagnostic pop
+#endif
                        row[col] = label;
                }
                for(col = 0; col < 8; col++) {
diff --git a/src/ghex-window.c b/src/ghex-window.c
index b855195..d1d0650 100644
--- a/src/ghex-window.c
+++ b/src/ghex-window.c
@@ -781,8 +781,10 @@ ghex_window_update_status_message(GHexWindow *win)
         return;
     }
 
+#if defined(__GNUC__) && (__GNUC__ > 4)
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wformat-nonliteral"
+#endif
     current_pos = gtk_hex_get_cursor(win->gh);
     if(g_snprintf(fmt, FMT_LEN, _("Offset: %s"), offset_fmt) < FMT_LEN) {
         g_snprintf(status, STATUS_LEN, fmt, current_pos);
@@ -797,7 +799,9 @@ ghex_window_update_status_message(GHexWindow *win)
                 }
             }
         }
+#if defined(__GNUC__) && (__GNUC__ > 4)
 #pragma GCC diagnostic pop
+#endif
 
         ghex_window_show_status(win, status);
     }
diff --git a/src/ui.c b/src/ui.c
index 37bc27e..c681777 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -112,13 +112,17 @@ create_dialog_title(GtkWidget *window, gchar *title)
 
        win = ghex_window_get_active();
 
+#if defined(__GNUC__) && (__GNUC__ > 4)
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wformat-nonliteral"
+#endif
        if(win != NULL && win->gh != NULL)
                full_title = g_strdup_printf(title, win->gh->document->path_end);
        else
                full_title = g_strdup_printf(title, "");
+#if defined(__GNUC__) && (__GNUC__ > 4)
 #pragma GCC diagnostic pop
+#endif
 
        if(full_title) {
                gtk_window_set_title(GTK_WINDOW(window), full_title);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]