[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gcc
Subject:    Re: [PATCH v2] Document that the 'access' and 'nonnull' attributes are independent
From:       Sebastian Huber <sebastian.huber () embedded-brains ! de>
Date:       2022-03-23 16:52:07
Message-ID: e8dcb924-226c-db55-229d-ebe9b2e58486 () embedded-brains ! de
[Download RAW message or body]

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/
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic