Automatic invariant generation
Steven Schveighoffer via Digitalmars-d
digitalmars-d at puremagic.com
Sun Jul 9 04:37:55 PDT 2017
On 7/9/17 7:00 AM, Walter Bright wrote:
> On 7/9/2017 3:37 AM, Steven Schveighoffer wrote:
>> Yet, here is an example of where we have effectively added a null
>> pointer exception. > At the very least, this should be eliminated on
>> Linux
>> and just use the signal handling null pointer error mechanism!
>
> You're a few years late, as pretty much nobody agreed with me that the
> operating system handling of it was plenty.
I think you misunderstand, we have etc.linux.memoryerror that can
actually throw an error on a null pointer using the signal handler.
I have a suggestion: eliminate this feature, and add a -npe switch to
the compiler that errors on any null pointer usage. Asserts will be
sprinkled in everywhere, but may be useful to someone debugging a nasty
null pointer segfault somewhere.
-Steve
More information about the Digitalmars-d
mailing list