aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2020-01-10 21:42:00 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2020-01-10 21:42:00 +0100
commit91df4397a1404df65de6de23426294c50ab88bd2 (patch)
tree017905b4b7d55aaba7eb024064e2fd9e26c5a550
parent530cfcd7b1cb92c752704c7115420d226a306971 (diff)
downloadgcc-91df4397a1404df65de6de23426294c50ab88bd2.zip
gcc-91df4397a1404df65de6de23426294c50ab88bd2.tar.gz
gcc-91df4397a1404df65de6de23426294c50ab88bd2.tar.bz2
re PR libgomp/93219 (unused return value in affinity-fmt.c)
PR libgomp/93219 * libgomp.h (gomp_print_string): Change return type from void to int. * affinity-fmt.c (gomp_print_string): Likewise. Return true if not all characters have been written. From-SVN: r280137
-rw-r--r--libgomp/ChangeLog7
-rw-r--r--libgomp/affinity-fmt.c4
-rw-r--r--libgomp/libgomp.h2
3 files changed, 10 insertions, 3 deletions
diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index 78d6481..152e52c 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,10 @@
+2020-01-10 Jakub Jelinek <jakub@redhat.com>
+
+ PR libgomp/93219
+ * libgomp.h (gomp_print_string): Change return type from void to int.
+ * affinity-fmt.c (gomp_print_string): Likewise. Return true if
+ not all characters have been written.
+
2020-01-08 Tobias Burnus <tobias@codesourcery.com>
* libgomp.texi: Fix typos, use https.
diff --git a/libgomp/affinity-fmt.c b/libgomp/affinity-fmt.c
index c423e35..9a5334d 100644
--- a/libgomp/affinity-fmt.c
+++ b/libgomp/affinity-fmt.c
@@ -37,10 +37,10 @@
#include <sys/utsname.h>
#endif
-void
+bool
gomp_print_string (const char *str, size_t len)
{
- fwrite (str, 1, len, stderr);
+ return fwrite (str, 1, len, stderr) != len;
}
void
diff --git a/libgomp/libgomp.h b/libgomp/libgomp.h
index 01eb1fb..44703aa 100644
--- a/libgomp/libgomp.h
+++ b/libgomp/libgomp.h
@@ -832,7 +832,7 @@ extern void gomp_display_affinity_place (char *, size_t, size_t *, int);
/* affinity-fmt.c */
-extern void gomp_print_string (const char *str, size_t len);
+extern bool gomp_print_string (const char *str, size_t len);
extern void gomp_set_affinity_format (const char *, size_t);
extern void gomp_display_string (char *, size_t, size_t *, const char *,
size_t);