Message ID | 20230428122142.928135-5-fberat@redhat.com |
---|---|
State | New |
Headers | show |
Series | Fix warn unused result | expand |
On 2023-04-28 08:21, Frédéric Bérat wrote: > Fix unused result warnings, detected when _FORTIFY_SOURCE is enabled in > glibc. > --- > nptl_db/thread_dbP.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) LGTM. Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org> > > diff --git a/nptl_db/thread_dbP.h b/nptl_db/thread_dbP.h > index 8845722109..4a9333658b 100644 > --- a/nptl_db/thread_dbP.h > +++ b/nptl_db/thread_dbP.h > @@ -61,7 +61,7 @@ enum > > /* Comment out the following for less verbose output. */ > #ifndef NDEBUG > -# define LOG(c) if (__td_debug) write (2, c "\n", strlen (c "\n")) > +# define LOG(c) if (__td_debug) assert (write (2, c "\n", strlen (c "\n")) == strlen (c "\n")) > extern int __td_debug attribute_hidden; > #else > # define LOG(c)
On 2023-05-24 20:51, Siddhesh Poyarekar wrote: > > > On 2023-04-28 08:21, Frédéric Bérat wrote: >> Fix unused result warnings, detected when _FORTIFY_SOURCE is enabled in >> glibc. >> --- >> nptl_db/thread_dbP.h | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) > > LGTM. > > Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org> Actually... >> >> diff --git a/nptl_db/thread_dbP.h b/nptl_db/thread_dbP.h >> index 8845722109..4a9333658b 100644 >> --- a/nptl_db/thread_dbP.h >> +++ b/nptl_db/thread_dbP.h >> @@ -61,7 +61,7 @@ enum >> /* Comment out the following for less verbose output. */ >> #ifndef NDEBUG >> -# define LOG(c) if (__td_debug) write (2, c "\n", strlen (c "\n")) >> +# define LOG(c) if (__td_debug) assert (write (2, c "\n", strlen (c >> "\n")) == strlen (c "\n")) This crossed 79 chars and needs to be split. >> extern int __td_debug attribute_hidden; >> #else >> # define LOG(c) >
diff --git a/nptl_db/thread_dbP.h b/nptl_db/thread_dbP.h index 8845722109..4a9333658b 100644 --- a/nptl_db/thread_dbP.h +++ b/nptl_db/thread_dbP.h @@ -61,7 +61,7 @@ enum /* Comment out the following for less verbose output. */ #ifndef NDEBUG -# define LOG(c) if (__td_debug) write (2, c "\n", strlen (c "\n")) +# define LOG(c) if (__td_debug) assert (write (2, c "\n", strlen (c "\n")) == strlen (c "\n")) extern int __td_debug attribute_hidden; #else # define LOG(c)