From patchwork Fri Jul 15 01:49:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Orling X-Patchwork-Id: 72058 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp369168qga; Thu, 14 Jul 2016 18:50:43 -0700 (PDT) X-Received: by 10.98.63.1 with SMTP id m1mr7670464pfa.14.1468547443403; Thu, 14 Jul 2016 18:50:43 -0700 (PDT) Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id m127si5630714pfc.279.2016.07.14.18.50.42; Thu, 14 Jul 2016 18:50:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org Received: from layers.openembedded.org (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id 6231E731C4; Fri, 15 Jul 2016 01:50:36 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mail.openembedded.org (Postfix) with ESMTP id 0353E731B9 for ; Fri, 15 Jul 2016 01:49:01 +0000 (UTC) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 14 Jul 2016 18:49:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,365,1464678000"; d="scan'208";a="995612656" Received: from timo-fedora.jf.intel.com ([10.7.201.162]) by orsmga001.jf.intel.com with ESMTP; 14 Jul 2016 18:49:02 -0700 From: Tim Orling To: openembedded-core@lists.openembedded.org Date: Thu, 14 Jul 2016 18:49:36 -0700 Message-Id: X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Subject: [OE-core] [krogoth][PATCH 5/8] glib-2.0: Ignore useless warning found with gcc-6 X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org From: Khem Raj ../../glib-2.46.2/glib/gdate.c:2497:7: error: format not a string literal, format string not checked [-Werror=format-nonliteral] tmplen = strftime (tmpbuf, tmpbufsize, locale_format, &tm); ^~~~~~ | ../../../../../../../../workspace/sources/glib-2.0/glib/tests/gdatetime.c: In function 'test_strftime': | ../../../../../../../../workspace/sources/glib-2.0/glib/tests/gdatetime.c:1338:3: error: '%c' yields only last 2 digits of year in some locales [-Werror=format-y2k] | "a%a A%A b%b B%B c%c C%C d%d e%e F%F g%g G%G h%h H%H I%I j%j m%m M%M " \ Additionally fix the problem seen where write() return code is ignored (From OE-Core rev: 3fdecff96dd7516605ec9248b2a39de4db81306f) Signed-off-by: Khem Raj Signed-off-by: Richard Purdie --- .../0001-Do-not-ignore-return-value-of-write.patch | 42 ++++++++++++++++++++++ .../glib-2.0/0002-tests-Ignore-y2k-warnings.patch | 42 ++++++++++++++++++++++ .../ignore-format-nonliteral-warning.patch | 39 ++++++++++++++++++++ meta/recipes-core/glib-2.0/glib-2.0_2.46.2.bb | 7 ++-- 4 files changed, 128 insertions(+), 2 deletions(-) create mode 100644 meta/recipes-core/glib-2.0/glib-2.0/0001-Do-not-ignore-return-value-of-write.patch create mode 100644 meta/recipes-core/glib-2.0/glib-2.0/0002-tests-Ignore-y2k-warnings.patch create mode 100644 meta/recipes-core/glib-2.0/glib-2.0/ignore-format-nonliteral-warning.patch -- 2.7.4 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/recipes-core/glib-2.0/glib-2.0/0001-Do-not-ignore-return-value-of-write.patch b/meta/recipes-core/glib-2.0/glib-2.0/0001-Do-not-ignore-return-value-of-write.patch new file mode 100644 index 0000000..aee96aa --- /dev/null +++ b/meta/recipes-core/glib-2.0/glib-2.0/0001-Do-not-ignore-return-value-of-write.patch @@ -0,0 +1,42 @@ +From d6501b107940e9f548c89236d773c6d33c15a5c9 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 16 Apr 2016 13:28:59 -0700 +Subject: [PATCH 1/2] Do not ignore return value of write() + +gcc warns about ignoring return value when compiling +with fortify turned on. + +assert when write() fails + +Signed-off-by: Khem Raj +--- +Upstream-Status: Submitted + + glib/tests/unix.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/glib/tests/unix.c b/glib/tests/unix.c +index 3543458..4e7ed85 100644 +--- a/glib/tests/unix.c ++++ b/glib/tests/unix.c +@@ -32,14 +32,15 @@ test_pipe (void) + GError *error = NULL; + int pipefd[2]; + char buf[1024]; +- ssize_t bytes_read; ++ ssize_t bytes_read, bytes_written; + gboolean res; + + res = g_unix_open_pipe (pipefd, FD_CLOEXEC, &error); + g_assert (res); + g_assert_no_error (error); + +- write (pipefd[1], "hello", sizeof ("hello")); ++ bytes_written = write (pipefd[1], "hello", sizeof ("hello")); ++ g_assert (bytes_written != -1 && "write() failed"); + memset (buf, 0, sizeof (buf)); + bytes_read = read (pipefd[0], buf, sizeof(buf) - 1); + g_assert_cmpint (bytes_read, >, 0); +-- +2.8.0 + diff --git a/meta/recipes-core/glib-2.0/glib-2.0/0002-tests-Ignore-y2k-warnings.patch b/meta/recipes-core/glib-2.0/glib-2.0/0002-tests-Ignore-y2k-warnings.patch new file mode 100644 index 0000000..f61fa0a --- /dev/null +++ b/meta/recipes-core/glib-2.0/glib-2.0/0002-tests-Ignore-y2k-warnings.patch @@ -0,0 +1,42 @@ +From b06b22fecc7deda8c65e28670562ca2371e4e725 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Sat, 16 Apr 2016 13:43:54 -0700 +Subject: [PATCH 2/2] tests: Ignore y2k warnings + +silences +| ../../../../../../../../workspace/sources/glib-2.0/glib/tests/gdatetime.c: In function 'test_strftime': +| ../../../../../../../../workspace/sources/glib-2.0/glib/tests/gdatetime.c:1338:3: error: '%c' yields only last 2 digits of year in some locales [-Werror=format-y2k] +| "a%a A%A b%b B%B c%c C%C d%d e%e F%F g%g G%G h%h H%H I%I j%j m%m M%M " + +Signed-off-by: Khem Raj +--- +Upstream-Status: Submitted + + glib/tests/gdatetime.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/glib/tests/gdatetime.c b/glib/tests/gdatetime.c +index 16a163c..e6062fc 100644 +--- a/glib/tests/gdatetime.c ++++ b/glib/tests/gdatetime.c +@@ -1326,6 +1326,9 @@ test_z (void) + g_time_zone_unref (tz); + } + ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wformat-y2k" ++ + static void + test_strftime (void) + { +@@ -1351,6 +1354,7 @@ test_strftime (void) + } + #endif + } ++#pragma GCC diagnostic pop + + static void + test_find_interval (void) +-- +2.8.0 + diff --git a/meta/recipes-core/glib-2.0/glib-2.0/ignore-format-nonliteral-warning.patch b/meta/recipes-core/glib-2.0/glib-2.0/ignore-format-nonliteral-warning.patch new file mode 100644 index 0000000..d533975 --- /dev/null +++ b/meta/recipes-core/glib-2.0/glib-2.0/ignore-format-nonliteral-warning.patch @@ -0,0 +1,39 @@ +From 8cdbc7fb2c8c876902e457abe46ee18a0b134486 Mon Sep 17 00:00:00 2001 +From: coypu +Date: Wed, 2 Mar 2016 19:38:48 +0200 +Subject: gdate: Move warning pragma outside of function + +Commit 0817af40e8c74c721c30f6ef482b1f53d12044c7 breaks the build on +older versions of GCC, which don't allow pragma inside functions. + +https://bugzilla.gnome.org/761550 +--- +Upstream-Status: Backport +Signed-off-by: Khem Raj + + glib/gdate.c | 8 +++++--- + 1 file changed, 5 insertions(+), 3 deletions(-) + +diff --git a/glib/gdate.c b/glib/gdate.c +index cdc735c..92c34d2 100644 +--- a/glib/gdate.c ++++ b/glib/gdate.c +@@ -2439,6 +2439,9 @@ win32_strftime_helper (const GDate *d, + * + * Returns: number of characters written to the buffer, or 0 the buffer was too small + */ ++#pragma GCC diagnostic push ++#pragma GCC diagnostic ignored "-Wformat-nonliteral" ++ + gsize + g_date_strftime (gchar *s, + gsize slen, +@@ -2552,3 +2552,5 @@ g_date_strftime (gchar *s, + return retval; + #endif + } ++ ++#pragma GCC diagnostic pop +-- +cgit v0.12 + diff --git a/meta/recipes-core/glib-2.0/glib-2.0_2.46.2.bb b/meta/recipes-core/glib-2.0/glib-2.0_2.46.2.bb index 8e445b4..9e95149 100644 --- a/meta/recipes-core/glib-2.0/glib-2.0_2.46.2.bb +++ b/meta/recipes-core/glib-2.0/glib-2.0_2.46.2.bb @@ -13,11 +13,14 @@ SRC_URI = "${GNOME_MIRROR}/glib/${SHRT_VER}/glib-${PV}.tar.xz \ file://uclibc_musl_translation.patch \ file://0001-configure.ac-Do-not-use-readlink-when-cross-compilin.patch \ file://allow-run-media-sdX-drive-mount-if-username-root.patch \ - file://0001-Remove-the-warning-about-deprecated-paths-in-schemas.patch \ + file://0001-Remove-the-warning-about-deprecated-paths-in-schemas.patch \ file://Enable-more-tests-while-cross-compiling.patch \ file://gi-exclude.patch \ file://0001-Install-gio-querymodules-as-libexec_PROGRAM.patch \ - " + file://ignore-format-nonliteral-warning.patch \ + file://0001-Do-not-ignore-return-value-of-write.patch \ + file://0002-tests-Ignore-y2k-warnings.patch \ + " SRC_URI_append_class-native = " file://glib-gettextize-dir.patch \ file://relocate-modules.patch"