------- Comment #3 from acahalan at gmail dot com 2006-02-19 23:09 ------- Here is an example of something that fundamentally can not be done in plain C.
Suppose I have a large project with a badly-named global variable. When I compile with -Wshadow, I get lots of complaints. I'd like to rename the global incrementally. Renaming the variable in one step is too painful because of the size of the project, which might involve 3rd-party modules and various development forks. So I have a mess, and I'd like to rename the variable. I could put the badly-named variable in a union with a better-named variable. Then I change what I can find. Then I use __attribute__((deprecated)) to mark the old name. After some time has passed, I no longer need the old name. I can't do this with a #define because that would clobber local variables and struct members. I might get a conflict. There may be linker tricks that would work, but dealing with the build system can be dreadful. (I've seen some build systems that might make you cry.) -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26370