[Issue 9289] [Regression 2.061] Had been deprecated language features are enabled again in default
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Feb 27 09:24:38 PST 2013
http://d.puremagic.com/issues/show_bug.cgi?id=9289
--- Comment #26 from Leandro Lucarella <leandro.lucarella at sociomantic.com> 2013-02-27 09:24:34 PST ---
(In reply to comment #25)
> > > -dXX should give a warning (not an error, not silence), whenever a deprecated
> > > feature is used when errors are gagged.
> >
> > You're talking about a new flag I guess...
>
> Not necessarily. It could be done with -dw for example.
But then make -dw mean something different than <no flag at all>, right? Just
trying to understand your suggestion.
> > > In other cases, the existing behaviour (silence) should be preserved.
> >
> > Only when gagged I assume.
>
> Yes, otherwise it's an error.
Mmm, an error? Using -de I guess, if that's the default this is like reverting
the "make deprecations issue warnings by default".
> > > Basically I think that with any form of -d option, deprecated features should
> > > never compile without generating a warning (even when errors are gagged).
> >
> > Except for plain -d I guess. That's the original meaning of -d, silence
> > everything.
>
> Possibly. We should just kill that, it's ridiculous.
Maybe.
> > Only when errors are gagged I guess. Otherwise is going back to where we
> > started.
>
> When errors aren't gagged, using a deprecated feature is just an error. (The
> wording may mention that it's deprecated, but otherwise it's a normal error).
> When errors are gagged, it's again just an error, but nothing is printed.
Why should it be an error to use a deprecated feature? I still don't understand
why is this desirable when it was the whole point of making "deprecation as
warnings by default". With this, you upgrade to a new DMD version and your code
gets broken if you happened to be using a recently deprecated feature instead
of just getting a deprecation message. Deprecating something means "it will be
removed in the future" not "it already have been removed". And if you used some
deprecated feature where errors are gagged, you're application will change its
behaviour without any warnings.
> When compiled with -dw, whenever anything deprecated is encountered, display a
> warning message. Display this even if errors are gagged.
>
> ie, anything deprecated is either a normal error, or noisy accepted, and this
> is not affected by gagging.
I think this really makes the feature useless. If you don't use -dw, your code
won't compile. If you use it, you'll potentially get a lot of spurious warnings
about gagged code that is using some feature that used to have a different
meaning a while ago.
I think that's far from ideal...
If we leave things are they are now, the only problem I see is you don't know
if some piece of error-gagged code uses a deprecated feature or not, and you'll
only find out when the feature is completely removed, if you are lucky enough
to notice the program changed its behaviour (if we keep deprecated features as
errors, this will happen as soon as the feature gets deprecated instead of
removed). Maybe we can add a flag (-dv for verbose maybe?) to print warnings
for deprecated errors even when errors are gagged.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list