"Jonathan M Davis" <[email protected]> wrote in message news:mailman.1522.1310360091.14074.digitalmars-d-annou...@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.
