Bug 30063 - It would be useful for __attribute__((deprecated)) to take an optional parameter
Summary: It would be useful for __attribute__((deprecated)) to take an optional parameter
Status: RESOLVED DUPLICATE of bug 36892
Alias: None
Product: gcc
Classification: Unclassified
Component: c (show other bugs)
Version: 4.3.0
: P3 enhancement
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-12-04 13:40 UTC by bero
Modified: 2009-12-31 05:55 UTC (History)
5 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-12-09 22:43:35


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bero 2006-12-04 13:40:40 UTC
People are probably more likely to fix their code if they're told how -- it would be useful to have

void new_function() { }
void __attribute__((deprecated("use new_function instead")) old_function() { }

int main(int argc, char **argv) {
        old_function();
}

resulting in
test.cpp: 6: warning: 'old_function' is deprecated (declared at test.cpp:2, use new_function instead)
Comment 1 Andrew Pinski 2006-12-09 22:43:35 UTC
Confirmed.
Comment 2 Eric Blake 2009-12-31 04:41:22 UTC
Conversely, it would be nice for __attribute__((warning)) and __attribute__((error)) to allow omitting their argument (in other words, it would be nice to have all three of deprecated, warning, and error act consistently and take 0 or 1 arg).
Comment 3 H.J. Lu 2009-12-31 05:55:41 UTC

*** This bug has been marked as a duplicate of 36892 ***