[dmd-internals] [D-Programming-Language/dmd] 588161: Add option to show deprecated errors as warnings

Leandro Lucarella luca at llucax.com.ar
Mon Nov 12 02:08:23 PST 2012


Jonathan M Davis, el 12 de November a las 00:04 me escribiste:
> On Sunday, November 11, 2012 23:15:56 GitHub wrote:
> >   Add option to show deprecated errors as warnings
> 
> I would point out that while this is nice, what we really need is for this to 
> be the default and for deprecated to generate errors only when the appropriate 
> flag is given. Without that, deprecating something will immediately break any 
> code which uses the deprecated symbol, making it so that any library 
> (including Phobos) which wants to avoid breaking user code, can't use 
> deprecated. On the other hand, if deprecated generates a warning by default, 
> then anyone using the deprecated symbol will be warned about it and have the 
> opportunity to fix it at their own leasure. It would then be possible to 
> deprecate something and potentially leave it around for long periods of time 
> before actually removing it (or maybe even leave it in permanently). As it is, 
> almost the only difference between deprecating something and removing it is 
> that when you deprecate it, you get a message telling you that it was 
> deprecated rather than that it's an unknown symbol.
> 
> So, this change is backwards.

I'll be more than happy to make the changes if you convince Walter to merge
them, it took me more than an year to convince him of this change, and it was
completely backwards compatible :D

I did it this way just to increase the chances of being merged, but I strongly
believe the right default is to emit warnings for deprecations and have, say,
-de for convert them to errors and the regular -d to completely silence them.

Backwards compatibility is not a huge problem as for the extremely special
cases when somebody want's the old behaviour as default, it can just add -de to
dmd.conf and that's it.

-- 


More information about the dmd-internals mailing list