Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 24 Feb 2023 18:00:18 +0100
From: Jₑₙₛ Gustedt <jens.gustedt@...ia.fr>
To: Tamir Duberstein <tamird@...gle.com>
Cc: musl@...ts.openwall.com, NRK <nrk@...root.org>, Rich Felker
 <dalias@...c.org>
Subject: Re: undefined behavior in fread.c

Tamir,

on Fri, 24 Feb 2023 11:42:30 -0500 you (Tamir Duberstein
<tamird@...gle.com>) wrote:

> Internal UB means "applying zero offset to null pointer" when the
> caller passes (NULL, _, 0, _).

So you mean internal misbehavior?

> Does such an attribute exist?

Yes, gcc has the nonnull old-style attribute, and I think that the C23
versions of gcc and clang will have something like `[[gnu::nonnull]]`.

Having this as attribute of the function and not of the pointer is a
bit unfortunate. For non-void pointers you could also use the `[static
1]` array parameter notation instead of a pointer.

Jₑₙₛ

-- 
:: ICube :::::::::::::::::::::::::::::: deputy director ::
:: Université de Strasbourg :::::::::::::::::::::: ICPS ::
:: INRIA Nancy Grand Est :::::::::::::::::::::::: Camus ::
:: :::::::::::::::::::::::::::::::::::: ☎ +33 368854536 ::
:: https://icube-icps.unistra.fr/index.php/Jens_Gustedt ::

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.