Should we warn if we detect null derefernces or void value uses ?

Jonathan M Davis via Digitalmars-d digitalmars-d at puremagic.com
Mon Dec 5 10:29:20 PST 2016


On Monday, December 05, 2016 08:35:34 Andrei Alexandrescu via Digitalmars-d 
wrote:
> On 12/04/2016 11:41 PM, Stefan Koch wrote:
> > Hi Guys,
> > What is your opinion, should we warn if we unambiguously detect
> > something that is clearly unwanted ?
> >
> > int fn(int y)
> > {
> >
> >   int x = void;
> >   ++x;
> >   return x+y;
> >
> > }
>
> No new warnings please. If something (such as the above) is definitely
> wrong - the code is not memory unsafe but is definitely in error - then
> just issue an error. That should be done whether or not the function is
> used in CTFE. -- Andrei

+1

- Jonathan M Davis



More information about the Digitalmars-d mailing list