unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer via Libc-alpha <libc-alpha@sourceware.org>
To: Siddhesh Poyarekar via Libc-alpha <libc-alpha@sourceware.org>
Cc: Siddhesh Poyarekar <siddhesh@sourceware.org>
Subject: Re: [PATCH] xmalloc: Fix warnings with gcc analyzer
Date: Wed, 28 Jul 2021 12:28:20 +0200	[thread overview]
Message-ID: <87wnpa91h7.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <20210728050928.3873663-1-siddhesh@sourceware.org> (Siddhesh Poyarekar via Libc-alpha's message of "Wed, 28 Jul 2021 10:39:28 +0530")

* Siddhesh Poyarekar via Libc-alpha:

> diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h
> index 30a621ab8f..d3203c73df 100644
> --- a/misc/sys/cdefs.h
> +++ b/misc/sys/cdefs.h
> @@ -330,6 +330,16 @@
>  # define __nonnull(params) _GL_ATTRIBUTE_NONNULL (params)
>  #endif
>  
> +/* The returns_nonnull function attribute marks the return type of the function
> +   as always being non-null.  */
> +#ifndef __returns_nonnull
> +# if __GNUC_PREREQ (4, 9) || __glibc_has_attribute (__returns_nonnull__)
> +# define __returns_nonnull __attribute__ ((returns_nonnull))
> +# else
> +# define __returns_nonnull
> +# endif
> +#endif

This needs to use __returns_nonnull__ in the attribute argument.

Thanks,
Florian


      reply	other threads:[~2021-07-28 10:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-28  5:09 [PATCH] xmalloc: Fix warnings with gcc analyzer Siddhesh Poyarekar via Libc-alpha
2021-07-28 10:28 ` Florian Weimer via Libc-alpha [this message]

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

  List information: https://www.gnu.org/software/libc/involved.html

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

  git send-email \
    --in-reply-to=87wnpa91h7.fsf@oldenburg.str.redhat.com \
    --to=libc-alpha@sourceware.org \
    --cc=fweimer@redhat.com \
    --cc=siddhesh@sourceware.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).