* [PATCH] malloc.c: Remove bogus __nonnull attribute @ 2023-07-11 13:59 Alejandro Colomar 2023-07-11 16:55 ` DJ Delorie 0 siblings, 1 reply; 3+ messages in thread From: Alejandro Colomar @ 2023-07-11 13:59 UTC (permalink / raw) To: libc-alpha; +Cc: Alejandro Colomar This function doesn't accept pointers. Signed-off-by: Alejandro Colomar <alx@kernel.org> --- malloc/malloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/malloc/malloc.c b/malloc/malloc.c index e2f1a615a4..ec97a96f57 100644 --- a/malloc/malloc.c +++ b/malloc/malloc.c @@ -1315,7 +1315,7 @@ nextchunk-> +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ MINSIZE in case the value is less than MINSIZE, or 0 if any of the previous checks fail. */ static inline size_t -checked_request2size (size_t req) __nonnull (1) +checked_request2size (size_t req) { if (__glibc_unlikely (req > PTRDIFF_MAX)) return 0; -- 2.40.1 ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] malloc.c: Remove bogus __nonnull attribute 2023-07-11 13:59 [PATCH] malloc.c: Remove bogus __nonnull attribute Alejandro Colomar @ 2023-07-11 16:55 ` DJ Delorie 2023-07-11 23:07 ` Alejandro Colomar 0 siblings, 1 reply; 3+ messages in thread From: DJ Delorie @ 2023-07-11 16:55 UTC (permalink / raw) To: Alejandro Colomar; +Cc: libc-alpha Alejandro Colomar via Libc-alpha <libc-alpha@sourceware.org> writes: > This function doesn't accept pointers. Does __nonnull() tell the compiler anything about not-pointers that can't be zero? Asking for a friend... ;-) LGTM Reviewed-by: DJ Delorie <dj@redhat.com> > -checked_request2size (size_t req) __nonnull (1) > +checked_request2size (size_t req) ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] malloc.c: Remove bogus __nonnull attribute 2023-07-11 16:55 ` DJ Delorie @ 2023-07-11 23:07 ` Alejandro Colomar 0 siblings, 0 replies; 3+ messages in thread From: Alejandro Colomar @ 2023-07-11 23:07 UTC (permalink / raw) To: DJ Delorie; +Cc: libc-alpha [-- Attachment #1.1: Type: text/plain, Size: 677 bytes --] On 2023-07-11 18:55, DJ Delorie wrote: > Alejandro Colomar via Libc-alpha <libc-alpha@sourceware.org> writes: >> This function doesn't accept pointers. > > Does __nonnull() tell the compiler anything about not-pointers that > can't be zero? Asking for a friend... ;-) > > LGTM > Reviewed-by: DJ Delorie <dj@redhat.com> Thanks! :-) Whoever applies this, you could also add: Fixes: 7519dee356a0 ("malloc: Simplify checked_request2size interface") > >> -checked_request2size (size_t req) __nonnull (1) >> +checked_request2size (size_t req) > -- <http://www.alejandro-colomar.es/> GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5 [-- Attachment #2: OpenPGP digital signature --] [-- Type: application/pgp-signature, Size: 833 bytes --] ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-07-11 23:07 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2023-07-11 13:59 [PATCH] malloc.c: Remove bogus __nonnull attribute Alejandro Colomar 2023-07-11 16:55 ` DJ Delorie 2023-07-11 23:07 ` Alejandro Colomar
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).