dmd 1.069 and 2.054 release

Jonathan M Davis jmdavisProg at gmx.com
Mon Jul 11 11:15:03 PDT 2011


On 2011-07-11 09:34, Nick Sabalausky wrote:
> "Jonathan M Davis" <jmdavisProg at gmx.com> wrote in message
> news:mailman.1522.1310360091.14074.digitalmars-d-announce at puremagic.com...
> 
> > On Monday 11 July 2011 14:26:32 Daniel Murphy wrote:
> >> Would the following cover all the common use cases? (Phobos seems to be
> >> the
> >> biggest user of deprecated so far)
> >> 
> >> deprecated("message") int a;
> >> deprecated("message", warn) int b;
> >> 
> >> With deprecated(warn) messages only being displayed with warnings
> >> enabled.
> > 
> > No. That's not quite right. If something is actually deprecated, -d is
> > required to compile using it. Being able to have a message with it - e.g.
> > deprecated("message") - would be very useful, because it could tell you
> > what
> > you're supposed to use instead (or that nothing is replacing it if that's
> > the
> > case). Error vs warning has nothing to do with it. Now, it could be that
> > compiling with -w would result in the message being printed even if you
> > compiled with -d, but that's debatable.
> > 
> > In the case of something which is scheduled for deprecation, the code
> > should
> > compile regardless. A message would print if that symbol were used, but
> > beyond
> > that, nothing happens. That _could_ be made so that it only prints when
> > you
> > compile with -w, and if it's classified as a warning, then that would
> > make sense, except that it shouldn't stop compilation even if compiling
> > with -w, so
> > it can't really follow what warnings normally do with -w. So, how it
> > should
> > function with regards to -w is debatable.
> 
> Despite the confusing non-standard descriptions in --help, -w is the "Treat
> warnings as errors" setting, so it *should* stop compilation - that's the
> whole point of -w. The proper "Turn warnings on" setting is -wi, not -w.

True. But when we're dealing with messages for something which is scheduled 
for deprecation, they're _not_ warnings. They're messages. They should never 
cause compilation to fail. What the best way to handle when they print or not 
is debatable, but they should never cause compilation to fail. So, even if 
they were printed because -w was used, they still shouldn't be errors. 
Personally, I'd probably just have them always print (and possibly include a 
separate flag for turning them off), but even if -w were used for enabling 
them, they shouldn't be errors. They're just messages. It's stuff that's 
actually deprecated that affects compilation.

- Jonathan M Davis


More information about the Digitalmars-d-announce mailing list