New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make deprecations as warnings the default #1287
Make deprecations as warnings the default #1287
Conversation
Since wanting to have deprecations as warnings is probably what most people wants, make it the default. Also rename -di to -dw and introduce -de to get the old default behaviour of having deprecations as errors. -d stays untouched for backwards compatibility and those crazy people that doesn't even want to know about deprecated features.
-dw would probably be bad, because -w makes warnings into errors. -di is a much better name in that regard. But since -di is new (and unreleased) and this pull request makes it unnecessary, I'd suggest just getting rid of it. I see no reason to keep it. |
On Wed, Nov 14, 2012 at 10:45:09AM -0800, Jonathan M Davis wrote:
I kept it to be able to override a potential -de that people wanting the About the name change, other people suggested -dw in the past and since That being said, I'll happy change it to whatever you want IIF someone Leandro Lucarella Senior R&D Developersociomantic labs GmbH DEUTSCHLANDhttp://www.sociomantic.comFon: +49 (0) 30 3087 4615 Facebook: http://bit.ly/labsfacebooksociomantic labs GmbH, Location: Berlin |
This pull request if failing because there is a "false deprecation" (a feature emits a deprecation but the backend always reject it, so it should be really an error). Here is a pull request to fix that: #1292 |
Breaking peoples' makefiles is as bad as breaking their code, or even worse as far too many people regard makefiles like they regard perl scripts - black magic - and don't dare touch anything in it. |
This pull request doesn't break anything, though. |
If I understand correctly, what this pull request does is
I really think that So, if anything, this reduces breakage rather than adding any. Or are we missing something here? |
And as I said, I'll be happy to change it if there is consensus to merge this patch after that change. |
And I just wanted to add that without this, all it will happen is people adding -di to their dmd.conf. I know I will :D |
Very true. |
It looks like this isn't compiling anymore, and this really should be resolved (preferably merged) prior to 2.061, or we're going to be introducing a flag that we're just going to turn around and deprecate. So, this needs to be updated so that it can compile, and Walter really should make a decision on this very soon. According to a post by Andrei in D.Announce, the deadline for pulls for 2.061 is supposed to be Sunday, and we really need this sorted out for 2.061. |
…on-warnings-as-default Make deprecations as warnings the default
Add -de switch for some deprecation tests in fail_compilation
Hey now that we have these nice new flags maybe we should consider introducing a warning for this: struct S
{
const int[] foo()
{
}
} E.g.: |
I think this is really off-topic for this pull request. If this should be added, it should be enabled with -w(i), this has nothing to do with deprectations (AFAIK this syntax is not deprecated, just "dangerous"). |
This got finally merged without further discussion about -di/-dw. I really don't care which one stay, but just wanted to mention that unless something gets done, -dw will be used to explicitly tell the compiler to emit deprecations as warnings (to override any other option). |
I found a big breaking introduced by this, in 2.061. In current, all deprecated language features until 2.060 are accepted in default. For example: void main() {
typedef int X = 10; // !!
X x;
assert(x == 10);
}
More than worse, all deprecations which reported in semantic phase or later will break code meaning silently. import std.stdio;
void main() {
int[] arr;
static if (is(typeof({ auto ptr = *arr; })))
writeln("*arr is not deprecated");
else
writeln("*arr is deprecated, instead use arr.ptr");
} The meaning of Therefore this is a huge breaking against the language improvement process in the past few years. |
To fix the problem, we need to split deprecated language features into the two.
|
Kenji, please file a regression. |
Deprecation is supposed to be a simple feature. Something has gone seriously wrong with it that there is all these "levels" of deprecation, regressions, all kinds of argument about it, etc. |
@WalterBright Deprecation feature/symbol has just a binary state, it is deprecated or not. But, in the reporting for the using of deprecation, two factors affect: 1. it makes an error (==aborting compilation) or not. 2. it reports a message or not. As far as I see, this regression has been caused by confusing the two factors. |
OK, filed as issue 9289 - [Regression 2.061] Had been deprecated language features are enabled again in default |
Document changes introduced by: dlang/dmd#1185 dlang/dmd#1287
Since wanting to have deprecations as warnings is probably what most
people wants, make it the default. Also rename -di to -dw and introduce
-de to get the old default behaviour of having deprecations as errors.
-d stays untouched for backwards compatibility and those crazy people
that doesn't even want to know about deprecated features.