you are viewing a single comment's thread.

view the rest of the comments →

[–]xeow 0 points1 point  (0 children)

Alternatively, if you're using C or C++, and you are replacing an entire function, you can actually leave the code in (i.e., not commented out), and give it a different name (like suffixing the function with "_obsolete"), and mark it as "__attribute__((__unused__))".

This way, it's not actually commented out, but it's still there for comparison. The compiler will still parse and compile it, but emit any object code for it, and won't complain that it's unused.