All of lore.kernel.org
 help / color / mirror / Atom feed
From: Khem Raj <raj.khem@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 03/42] glib-2.0: Ignore useless warning found with gcc-6
Date: Wed, 11 May 2016 10:35:06 -0700	[thread overview]
Message-ID: <10849ca9e96421349e60a8e3afc8fe5cfd96aeaa.1462987863.git.raj.khem@gmail.com> (raw)
In-Reply-To: <2e51e9b5fb3911436afc1becd5feb9351b896fa4.1462987863.git.raj.khem@gmail.com>
In-Reply-To: <cover.1462987863.git.raj.khem@gmail.com>

../../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

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 .../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

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 <raj.khem@gmail.com>
+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 <raj.khem@gmail.com>
+---
+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 <raj.khem@gmail.com>
+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 <raj.khem@gmail.com>
+---
+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 <coypu@sdf.org>
+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 <raj.khem@gmail.com>
+
+ 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"
-- 
2.8.2



  parent reply	other threads:[~2016-05-11 17:35 UTC|newest]

Thread overview: 77+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-11 17:35 [PATCH 00/42] GCC/GDB/Binutils Upgrades Khem Raj
2016-05-11 17:35 ` [PATCH 01/42] gcc: Add gcc6 recipes Khem Raj
2016-05-31  8:12   ` Jussi Kukkonen
2016-05-31 22:20     ` Paul Eggleton
2016-05-31 22:23       ` Paul Eggleton
2016-06-02 16:05         ` Martin Jansa
2016-06-02 19:15           ` Paul Eggleton
2016-06-02 19:19             ` Bruce Ashfield
2016-06-02 19:24               ` Paul Eggleton
2016-06-02 19:30                 ` Bruce Ashfield
2016-06-02 19:38                   ` Paul Eggleton
2016-06-02 19:43                     ` Bruce Ashfield
2016-06-02 22:18                 ` Christopher Larson
2016-05-11 17:35 ` [PATCH 02/42] glibc: Add recipes for 2.24 release Khem Raj
2016-05-12  5:50   ` Khem Raj
2016-05-11 17:35 ` Khem Raj [this message]
2016-05-11 17:35 ` [PATCH 04/42] elfutils: Upgrade to 0.166 Khem Raj
2016-05-11 17:35 ` [PATCH 05/42] rpm: Fix build with gcc6 Khem Raj
2016-05-11 17:35 ` [PATCH 06/42] alsa-tools: " Khem Raj
2016-05-11 17:35 ` [PATCH 07/42] lzop: Fix build with gcc-6 Khem Raj
2016-05-11 17:35 ` [PATCH 08/42] webkitgtk: Upgrade to 2.12.1 Khem Raj
2016-05-11 17:35 ` [PATCH 09/42] oprofile: Fix with gcc6 Khem Raj
2016-05-11 17:35 ` [PATCH 10/42] mdadm: Fix gcc 6 warnings Khem Raj
2016-05-11 17:35 ` [PATCH 11/42] nss: Upgrade to 3.23 Khem Raj
2016-05-11 17:35 ` [PATCH 12/42] pkgconfig: Fix build with gcc-6 and upgrade to 0.29.1 Khem Raj
2016-05-11 17:35 ` [PATCH 13/42] binutils: disable werror on native build Khem Raj
2016-05-11 17:35 ` [PATCH 14/42] grub: Fix build with gcc-6 Khem Raj
2016-05-11 17:35 ` [PATCH 15/42] valgrind: Fix build with gcc6 Khem Raj
2016-05-11 17:35 ` [PATCH 16/42] busybox/mdev: Ensure /sys is mounted before using it Khem Raj
2016-05-12 12:58   ` Andreas Oberritter
2016-05-11 17:35 ` [PATCH 17/42] libc-common.bbclass: Use sed instead of grep Khem Raj
2016-05-11 17:35 ` [PATCH 18/42] conf: bump minimum kernel to 3.2.0 Khem Raj
2016-05-12 17:18   ` Ruslan Bilovol
2016-05-12 18:26     ` Khem Raj
2016-05-11 17:35 ` [PATCH 19/42] systemd: Create missing sysusers offline Khem Raj
2016-05-13 12:44   ` Richard Purdie
2016-05-11 17:35 ` [PATCH 20/42] grub_git: Upgrade to latest tip Khem Raj
2016-05-11 17:35 ` [PATCH 21/42] libunwind: Upgrade to 1.2rc1+ Khem Raj
2016-05-11 17:35 ` [PATCH 22/42] linux-yocto: Fix build on ppc with gcc-6 Khem Raj
2016-05-11 21:27   ` Bruce Ashfield
2016-05-11 21:30     ` Khem Raj
2016-05-11 21:36       ` Bruce Ashfield
2016-05-11 21:55         ` Khem Raj
2016-05-12  4:31           ` Bruce Ashfield
2016-05-12 13:28             ` Bruce Ashfield
2016-05-12 14:21               ` Khem Raj
2016-05-12 14:27                 ` Bruce Ashfield
2016-05-12 14:27                   ` Khem Raj
2016-05-12 15:52                     ` Khem Raj
2016-05-11 17:35 ` [PATCH 23/42] linux-yocto: Fix build with gcc6 on mips Khem Raj
2016-05-11 17:35 ` [PATCH 24/42] python-native: Point to expat in native sysroot Khem Raj
2016-05-12  6:26   ` Khem Raj
2016-05-11 17:35 ` [PATCH 25/42] bitbake.conf: Empty out BUILDSDK_CPPFLAGS Khem Raj
2016-05-11 17:35 ` [PATCH 26/42] strace: Remove pipe.expected Khem Raj
2016-05-11 17:42   ` Khem Raj
2016-05-11 17:35 ` [PATCH 27/42] musl: Upgrade to tip of tree Khem Raj
2016-05-11 17:35 ` [PATCH 28/42] libgcc: Ensure that gcc configure options are passed to libgcc too Khem Raj
2016-05-11 17:35 ` [PATCH 29/42] libunwind: Upgrade to 1.2rc1+ Khem Raj
2016-05-11 17:35 ` [PATCH 30/42] libgcc: Ensure that gcc configure options are passed to libgcc too Khem Raj
2016-05-11 17:35 ` [PATCH 31/42] gdb,strace: Fix builds on ppc/musl Khem Raj
2016-05-11 17:35 ` [PATCH 32/42] libunwind: Add a confgure option for tests Khem Raj
2016-05-11 17:35 ` [PATCH 33/42] gdb: Upgrade to 7.11 Khem Raj
2016-05-12  5:48   ` Khem Raj
2016-05-11 17:35 ` [PATCH 34/42] gdb: Disable binutils components Khem Raj
2016-05-11 17:35 ` [PATCH 35/42] tcmode-default: Bump gcc,glibc,gdb Khem Raj
2016-05-11 17:35 ` [PATCH 36/42] bitbake: Oldest kernel for nios2 is 3.19 Khem Raj
2016-05-11 17:35 ` [PATCH 37/42] musl: Create symlinks for stub libraries Khem Raj
2016-05-11 17:35 ` [PATCH 38/42] mdadm: Fix build with clang Khem Raj
2016-05-11 17:35 ` [PATCH 39/42] distcc: Upgrade to 3.2 Khem Raj
2016-05-11 17:35 ` [PATCH 40/42] ruby: Upgrade to 2.2.5 Khem Raj
2016-05-11 17:35 ` [PATCH 41/42] mpfr: Upgrade to 3.1.4 Khem Raj
2016-05-11 17:35 ` [PATCH 42/42] gcc-runtime, libgcc: Symlink c++ header and startup files in target_triplet for SDK use Khem Raj
2016-05-12  9:05 ` [PATCH 00/42] GCC/GDB/Binutils Upgrades Ioan-Adrian Ratiu
2016-05-12 14:19   ` akuster808
2016-05-12 14:33     ` Ioan-Adrian Ratiu
2016-05-13 12:47 ` Richard Purdie
2016-05-13 16:48   ` Khem Raj

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=10849ca9e96421349e60a8e3afc8fe5cfd96aeaa.1462987863.git.raj.khem@gmail.com \
    --to=raj.khem@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.