[PATCH v5 03/12] nptl_db/thread_dbP.h: fix warn unused result

Siddhesh Poyarekar siddhesh@gotplt.org
Thu Jun 1 16:49:39 GMT 2023



On 2023-06-01 10:27, Frédéric Bérat wrote:
> Fix unused result warnings, detected when _FORTIFY_SOURCE is enabled in
> glibc.
> ---
> Changes since v5:
>   - Wrapped line since it exceeded 79 characters
> 
>   nptl_db/thread_dbP.h | 4 +++-
>   1 file changed, 3 insertions(+), 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..b52c254300 100644
> --- a/nptl_db/thread_dbP.h
> +++ b/nptl_db/thread_dbP.h
> @@ -61,7 +61,9 @@ 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)


More information about the Libc-alpha mailing list