Skip to contentSkip to conversation

glade: Fix format string warnings with clang

PATCH New Khem Raj 1 participant 2 messages Aug 27, 2017

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/2 glade: Fix format string warnings with clang

---
 ...C_PRINTF-on-functions-with-format-strings.patch | 62 ++++++++++++++++++++++
 meta-oe/recipes-devtools/glade/glade3_3.8.5.bb     | 10 ++--
 2 files changed, 67 insertions(+), 5 deletions(-)
 create mode 100644 meta-oe/recipes-devtools/glade/glade3/0001-Add-G_GNUC_PRINTF-on-functions-with-format-strings.patch
meta-oe/recipes-devtools/glade/glade3/0001-Add-G_GNUC_PRINTF-on-functions-with-format-strings.patch new file +62 -0
new file mode 100644
index 000000000..03cb762ce
@@ -0,0 +1,62 @@
+From fcf29abe59607b5791f9de18ddb86b9ae3c9b7cc Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Sat, 26 Aug 2017 23:50:05 -0700
+Subject: [PATCH] Add G_GNUC_PRINTF on functions with format strings
+
+This allows compilation with clang without errors, even when
+-Wformat-nonliteral is active (as long as there are no real cases of
+non literal formatting).
+
+Signed-off-by: Khem Raj <[email protected]>
+---
+ gladeui/glade-command.c | 4 ++--
+ gladeui/glade-utils.c   | 4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/gladeui/glade-command.c b/gladeui/glade-command.c
+index 9819766..4ac40ee 100644
+--- a/gladeui/glade-command.c
++++ b/gladeui/glade-command.c
+@@ -266,7 +266,7 @@ glade_command_collapse (GladeCommand  *command,
+  *
+  * Marks the begining of a group.
+  */
+-void
++G_GNUC_PRINTF(1, 2) void
+ glade_command_push_group (const gchar *fmt, ...)
+ {
+ 	va_list         args;
+@@ -655,7 +655,7 @@ glade_command_set_properties_list (GladeProject *project, GList *props)
+ 
+ 	multiple = g_list_length (me->sdata) > 1;
+ 	if (multiple)
+-		glade_command_push_group (cmd->description);
++		glade_command_push_group ("%s", cmd->description);
+ 
+ 
+ 	glade_command_check_group (GLADE_COMMAND (me));
+diff --git a/gladeui/glade-utils.c b/gladeui/glade-utils.c
+index ae52501..c51ae59 100644
+--- a/gladeui/glade-utils.c
++++ b/gladeui/glade-utils.c
+@@ -197,7 +197,7 @@ glade_utils_get_pspec_from_funcname (const gchar *funcname)
+  *          selected "OK", True if the @type was GLADE_UI_YES_OR_NO and
+  *          the user selected "YES"; False otherwise.
+  */
+-gint
++G_GNUC_PRINTF(4, 5) gint
+ glade_util_ui_message (GtkWidget           *parent, 
+ 		       GladeUIMessageType   type,
+ 		       GtkWidget           *widget,
+@@ -320,7 +320,7 @@ remove_message_timeout (FlashInfo * fi)
+  *
+  * Flash a temporary message on the statusbar.
+  */
+-void
++G_GNUC_PRINTF(3, 4) void
+ glade_util_flash_message (GtkWidget *statusbar, guint context_id, gchar *format, ...)
+ {
+ 	va_list args;
+-- 
+2.14.1
+
meta-oe/recipes-devtools/glade/glade3_3.8.5.bb +5 -5
index fd655366f..c4f600095 100644
@@ -8,11 +8,11 @@ DEPENDS = "gtk+ gnome-doc-utils gnome-common libxml2 intltool-native"
 
 inherit autotools pkgconfig pythonnative gtk-icon-cache
 
-SRC_URI = " \
-    http://ftp.gnome.org/pub/GNOME/sources/glade3/3.8/glade3-${PV}.tar.xz \
-    file://0001-gnome-doc-utils.make-sysrooted-pkg-config.patch \
-    file://0002-fix-gcc-6-build.patch \
-"
+SRC_URI = "http://ftp.gnome.org/pub/GNOME/sources/glade3/3.8/glade3-${PV}.tar.xz \
+           file://0001-gnome-doc-utils.make-sysrooted-pkg-config.patch \
+           file://0002-fix-gcc-6-build.patch \
+           file://0001-Add-G_GNUC_PRINTF-on-functions-with-format-strings.patch \
+           "
 SRC_URI[md5sum] = "4e4b4f5ee34a03e017e4cef97d796c1f"
 SRC_URI[sha256sum] = "58a5f6e4df4028230ddecc74c564808b7ec4471b1925058e29304f778b6b2735"
 
Signature · 1 line
2.14.1
author
#1 lore raw

PATCH 2/2 openhpi: Fix build with clang+c++11

---
 .../recipes-daemons/openhpi/files/c++11.patch      |   12 +
 .../openhpi/files/clang-c++11.patch                | 1288 ++++++++++++++++++++
 .../recipes-daemons/openhpi/openhpi_3.6.1.bb       |    4 +-
 3 files changed, 1303 insertions(+), 1 deletion(-)
 create mode 100644 meta-networking/recipes-daemons/openhpi/files/c++11.patch
 create mode 100644 meta-networking/recipes-daemons/openhpi/files/clang-c++11.patch
meta-networking/recipes-daemons/openhpi/files/c++11.patch new file +12 -0
new file mode 100644
index 000000000..0549d5977
@@ -0,0 +1,12 @@
+Index: openhpi-3.6.1/configure.ac
+===================================================================
+--- openhpi-3.6.1.orig/configure.ac
++++ openhpi-3.6.1/configure.ac
+@@ -44,6 +44,7 @@ AC_PROG_CPP
+ AC_PROG_INSTALL
+ AC_PROG_LN_S
+ AC_PROG_MAKE_SET
++AX_CXX_COMPILE_STDCXX_11([noext],[mandatory])
+ 
+ enabled_non32bit="no"
+ AC_ARG_ENABLE([non32bit-int],
meta-networking/recipes-daemons/openhpi/files/clang-c++11.patch new file +1288 -0

1,288 lines not on this page · raw message

meta-networking/recipes-daemons/openhpi/openhpi_3.6.1.bb +3 -1
index 16e58dc73..64b2cc38c 100644
@@ -20,7 +20,7 @@ SECTION = "net"
 LICENSE = "BSD"
 LIC_FILES_CHKSUM = "file://COPYING;md5=e3c772a32386888ccb5ae1c0ba95f1a4"
 
-DEPENDS = "net-snmp libxml2 ncurses openssl glib-2.0 popt e2fsprogs"
+DEPENDS = "net-snmp libxml2 ncurses openssl glib-2.0 popt e2fsprogs autoconf-archive-native"
 
 SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.gz \
            file://openhpi-netsnmp-cross-compile.patch \
@@ -36,6 +36,8 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/${BP}.tar.gz \
            file://openhpi-use-serial-tests-config-needed-by-ptest.patch \
            file://openhpi-fix-alignment-issue.patch \
            file://0001-Fix-build-failures-with-gcc7.patch \
+           file://c++11.patch \
+           file://clang-c++11.patch \
            \
            file://openhpi.init \
            file://openhpid.service \
Signature · 1 line
2.14.1