login
Header Space

 
 

deprecated

Deprecating __deprecated

October 26, 2007 - 9:03am
Submitted by Jeremy on October 26, 2007 - 9:03am.
Linux news

"The __deprecated marker is quite useful in highlighting the remnants of old APIs that want removing. However, it is quite normal for one or more years to pass, before the (usually ancient, bitrotten) code in question is either updated or deleted," explained Jeff Garzik, posting a small patch to make it possible to silence "warning: 'foo' is deprecated" type messages.

Andrew Morton wasn't impressed, suggesting, "Sigh. Can't we just fix the dud code? Or mark it BROKEN and see what happens?" Linus Torvalds added, "I think removing __deprecated is the better option. Quite frankly, some people add '__deprecated' *way* too eagerly." Jeff agreed that __deprecated is over used, "__deprecated has spread to just about every API that people don't consider fresh and up-to-date." He then added ,"like I noted in the patch description, rewriting grotty ISA/MCA/etc. probe code is a thankless, boring task that few are crazy enough to attempt :) As you can see from the patch flood recently I /have/ been working through the dud code, but it will still take years. The changes required for each are on average ~200 LOC changed, if not more."

Linux: Marking Code Obsolete Or Deprecated

January 21, 2007 - 3:38pm
Submitted by Jeremy on January 21, 2007 - 3:38pm.
Linux news

Robert Day proposed a couple of new kernel code maturity configuration options for tagging code as either "deprecated" or "obsolete". He referenced earlier confusion around the attempt to remove devfs [story] in which it wasn't clear on the current state and future plans for the code. He explained, "using deprecated code is still technically fine, but using obsolete code should be something that raises a red flag of some kind." Aside from a little confusion between the differences in definition between these two words, general feedback was positive. H. Peter Anvin supported the patch, "if nothing else, it gives some middle-of-the-roadness to the continual 'to remove or not to remove' debate." Robert also noted that the "deprecated" flag would be a useful sanity check when building a kernel, "this would seem to be a quick and dirty way to prune anything that is *supposed* to be obsolete from the build, to make sure you're not picking up dead code by accident." The patch includes definitions of these two states:

"Code that is tagged as 'deprecated' is officially still available for use but will typically have already been scheduled for removal at some point, so it's in your best interests to start looking for an alternative.

"Code that is tagged as 'obsolete' is officially no longer supported and shouldn't play a part in any normal build, but those features might still be available if you absolutely need access to them. You are *strongly* discouraged from continuing to depend on obsolete code on an ongoing, long-term basis."

speck-geostationary