Liste des Groupes | Revenir à c arch |
On Mon, 2 Sep 2024 20:52:21 +0000, Thomas Koenig wrote:
>Thomas Koenig <tkoenig@netcologne.de> schrieb:>
>"Don't do this" or "don't do that" is not sufficient. Maybe you,>
together with like-minded people, could try formulating some rules
as an extension to the C standard, and see where it gets you.
Maybe you can get it published as an annex.
Hm... putting some thought into it, it may be a good first step
to define cases for which a a diagnostic is required; maybe
"observable error" would be a reasonable term.
>
So, put "dereferencing a NULL pointer shall be an observable
error" would make sure that no null pointer checks are thrown
away, and that this requires a run-time diagnostic.
>
If that is the case, should dereferencing a member of a struct
pointed to by a null pointer also be an observable error, and
be required to be caught at run-time?
It depends::
>
Let
Base = NULL;
Index = &array / sizeof( array[0] );
>
is::
>
x = [base+index<<sale+small_offset]
>
u8ndefined ??
Les messages affichés proviennent d'usenet.