mirror of
git://git.openembedded.org/meta-openembedded
synced 2026-09-16 19:37:11 +00:00
Fix build error: ../../gtksourceview-2.10.5/gtksourceview/gtksourceprintcompositor.c: In function 'strdup_strftime': ../../gtksourceview-2.10.5/gtksourceview/gtksourceprintcompositor.c:1951:3: error: format not a string literal, format string not checked [-Werror=format-nonliteral] tmplen = strftime (tmpbuf, tmpbufsize, locale_format, tm); ^~~~~~ A wrapper for strftime() would compile failed with -Werror=format-nonliteral in newer GCC. See GCC bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39438 Since most of the strdup_strftime function code is taken from GLib's g_date_strftime() in gdate.c which already had a fix: https://bugzilla.gnome.org/show_bug.cgi?id=761550 So this patch refers the glib fixes: https://git.gnome.org/browse/glib/commit/?id=0817af40e8c74c721c30f6ef482b1f53d12044c7 https://git.gnome.org/browse/glib/commit/?id=8cdbc7fb2c8c876902e457abe46ee18a0b134486 Signed-off-by: Yi Zhao <yi.zhao@windriver.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> (cherry picked from commit ca363445b80b47f3e0c18cb9d96b9463ce86b913) Signed-off-by: Armin Kuster <akuster808@gmail.com>
34 lines
1.5 KiB
Diff
34 lines
1.5 KiB
Diff
Fix build error with gcc6:
|
|
../../gtksourceview-2.10.5/gtksourceview/gtksourceprintcompositor.c: In function 'strdup_strftime':
|
|
../../gtksourceview-2.10.5/gtksourceview/gtksourceprintcompositor.c:1951:3: error: format not a string literal, format string not checked [-Werror=format-nonliteral]
|
|
tmplen = strftime (tmpbuf, tmpbufsize, locale_format, tm);
|
|
^~~~~~
|
|
|
|
Patch Reference:
|
|
https://git.gnome.org/browse/glib/commit/?id=0817af40e8c74c721c30f6ef482b1f53d12044c7
|
|
https://git.gnome.org/browse/glib/commit/?id=8cdbc7fb2c8c876902e457abe46ee18a0b134486
|
|
|
|
Upstream-Status: Pending
|
|
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
|
|
|
|
diff -Nurp gtksourceview-2.10.5.orig/gtksourceview/gtksourceprintcompositor.c gtksourceview-2.10.5/gtksourceview/gtksourceprintcompositor.c
|
|
--- gtksourceview-2.10.5.orig/gtksourceview/gtksourceprintcompositor.c 2016-07-01 13:11:43.631173762 +0800
|
|
+++ gtksourceview-2.10.5/gtksourceview/gtksourceprintcompositor.c 2016-07-04 13:54:18.223726343 +0800
|
|
@@ -1913,6 +1913,8 @@ setup_pango_layouts (GtkSourcePrintCompo
|
|
* GLIB - Library of useful routines for C programming
|
|
* Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald */
|
|
|
|
+#pragma GCC diagnostic push
|
|
+#pragma GCC diagnostic ignored "-Wformat-nonliteral"
|
|
static gchar *
|
|
strdup_strftime (const gchar *format, const struct tm *tm)
|
|
{
|
|
@@ -1982,6 +1984,7 @@ strdup_strftime (const gchar *format, co
|
|
|
|
return convbuf;
|
|
}
|
|
+#pragma GCC diagnostic pop
|
|
|
|
static gchar *
|
|
evaluate_format_string (GtkSourcePrintCompositor *compositor,
|