[PATCH v2] Document that the 'access' and 'nonnull' attributes are independent
Sebastian Huber
sebastian.huber@embedded-brains.de
Wed Mar 23 16:52:07 GMT 2022
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/
More information about the Gcc
mailing list