null pointer dereference detection in DMD

Dave P. dave287091 at gmail.com
Fri Jan 17 05:30:10 UTC 2025


On Friday, 17 January 2025 at 04:22:51 UTC, Richard (Rikki) 
Andrew Cattermole wrote:
> Looks like the C folk are looking at adding nullability 
> qualifier to the language to merge the different compiler 
> support.
>
> https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3422.pdf
>
> Related an effect system: 
> https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3317.htm
>
> And if anyone is interested as to where you can find these 
> documents: 
> https://www.open-std.org/jtc1/sc22/wg14/www/wg14_document_log.htm

I’ve used clang’s nullability attributes for years and they work 
very well. It’s too bad the author of the paper wasn’t aware that 
you can write a `#pragma clang assume_nonnull begin` to avoid 
have to write `_Nonnull` on every pointer. Pointers in C are 
rarely null, so annotating the exception makes functions so much 
easier to use.


More information about the Digitalmars-d mailing list