diff options
author | Khem Raj <raj.khem@gmail.com> | 2016-05-11 10:35:06 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-05-13 13:41:29 +0100 |
commit | a088a4110751bc6dbad5e48c049158f53284057d (patch) | |
tree | 55bb7ce771048a4c14332374733017c6e9e088e4 /meta/recipes-core/glib-2.0/glib-2.0/0001-Do-not-ignore-return-value-of-write.patch | |
parent | 6ea164c208ab43251544525e83644a8f84d3a6f8 (diff) | |
download | poky-a088a4110751bc6dbad5e48c049158f53284057d.tar.gz |
glib-2.0: Ignore useless warning found with gcc-6
../../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 <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/glib-2.0/glib-2.0/0001-Do-not-ignore-return-value-of-write.patch')
-rw-r--r-- | meta/recipes-core/glib-2.0/glib-2.0/0001-Do-not-ignore-return-value-of-write.patch | 42 |
1 files changed, 42 insertions, 0 deletions
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 0000000000..aee96aaa6e --- /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 @@ | |||
1 | From d6501b107940e9f548c89236d773c6d33c15a5c9 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sat, 16 Apr 2016 13:28:59 -0700 | ||
4 | Subject: [PATCH 1/2] Do not ignore return value of write() | ||
5 | |||
6 | gcc warns about ignoring return value when compiling | ||
7 | with fortify turned on. | ||
8 | |||
9 | assert when write() fails | ||
10 | |||
11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
12 | --- | ||
13 | Upstream-Status: Submitted | ||
14 | |||
15 | glib/tests/unix.c | 5 +++-- | ||
16 | 1 file changed, 3 insertions(+), 2 deletions(-) | ||
17 | |||
18 | diff --git a/glib/tests/unix.c b/glib/tests/unix.c | ||
19 | index 3543458..4e7ed85 100644 | ||
20 | --- a/glib/tests/unix.c | ||
21 | +++ b/glib/tests/unix.c | ||
22 | @@ -32,14 +32,15 @@ test_pipe (void) | ||
23 | GError *error = NULL; | ||
24 | int pipefd[2]; | ||
25 | char buf[1024]; | ||
26 | - ssize_t bytes_read; | ||
27 | + ssize_t bytes_read, bytes_written; | ||
28 | gboolean res; | ||
29 | |||
30 | res = g_unix_open_pipe (pipefd, FD_CLOEXEC, &error); | ||
31 | g_assert (res); | ||
32 | g_assert_no_error (error); | ||
33 | |||
34 | - write (pipefd[1], "hello", sizeof ("hello")); | ||
35 | + bytes_written = write (pipefd[1], "hello", sizeof ("hello")); | ||
36 | + g_assert (bytes_written != -1 && "write() failed"); | ||
37 | memset (buf, 0, sizeof (buf)); | ||
38 | bytes_read = read (pipefd[0], buf, sizeof(buf) - 1); | ||
39 | g_assert_cmpint (bytes_read, >, 0); | ||
40 | -- | ||
41 | 2.8.0 | ||
42 | |||