Automatic invariant generation

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Mon Jul 10 11:29:42 PDT 2017


On 7/9/2017 4:37 AM, Steven Schveighoffer wrote:
> 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.

Windows creates a exception, too, on null seg faults.


> 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.

It's just redundant to add these.



More information about the Digitalmars-d mailing list