From: Sebastian Huber <sebastian.huber@embedded-brains.de>
To: Martin Sebor <msebor@gmail.com>,
David Malcolm <dmalcolm@redhat.com>,
gcc-patches@gcc.gnu.org, gcc@gcc.gnu.org
Subject: Re: [PATCH v2] Document that the 'access' and 'nonnull' attributes are independent
Date: Wed, 23 Mar 2022 17:52:07 +0100 [thread overview]
Message-ID: <e8dcb924-226c-db55-229d-ebe9b2e58486@embedded-brains.de> (raw)
In-Reply-To: <16768247-eacc-100c-fded-9aa42833867f@gmail.com>
On 23/03/2022 17:31, Martin Sebor via Gcc-patches wrote:
>
> The concern is that the constraints implied by atttributes access and
> nonnull are independent of each other. I would suggest to document
> that without talking about dereferencing because that's not implied
> by either of them. E.g., something like this (feel free to tweak it
> as you see fit):
>
> Note that the @code{access} attribute doesn't imply the same
> constraint as attribute @code{nonnull} (@pxref{Attribute nonnull}).
> The latter attribute should be used to annotate arguments that must
> never be null, regardless of the value of the size argument.
I would not give an advice on using the nonnull attribute here. This
attribute could have pretty dangerous effects in the function definition
(removal of null pointer checks).
--
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber@embedded-brains.de
phone: +49-89-18 94 741 - 16
fax: +49-89-18 94 741 - 08
Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/
next prev parent reply other threads:[~2022-03-23 16:52 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-09 21:23 __attribute__ ((access, ...)) vs __attribute__ ((nonnull)) David Malcolm
2022-03-09 21:30 ` Andrew Pinski
2022-03-09 21:57 ` [PATCH] Document that the 'access' and 'nonnull' attributes are independent David Malcolm
2022-03-14 22:18 ` Martin Sebor
2022-03-23 13:01 ` [PATCH v2] " David Malcolm
2022-03-23 16:31 ` Martin Sebor
2022-03-23 16:52 ` Sebastian Huber [this message]
2022-03-25 18:45 ` [PATCH v3] " David Malcolm
2022-03-25 20:38 ` Martin Sebor
2022-04-05 20:46 ` David Malcolm
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e8dcb924-226c-db55-229d-ebe9b2e58486@embedded-brains.de \
--to=sebastian.huber@embedded-brains.de \
--cc=dmalcolm@redhat.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=gcc@gcc.gnu.org \
--cc=msebor@gmail.com \
/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).