What is the worst real-world macros/pre-processor abuse you've ever come across?

Posted by Trevor Boyd Smith on Stack Overflow See other posts from Stack Overflow or by Trevor Boyd Smith
Published on 2009-03-17T01:57:42Z Indexed on 2010/03/11 21:39 UTC
Read the original article Hit count: 239

What is the worst real-world macros/pre-processor abuse you've ever come across (please no contrived IOCCC answers *haha*)?

Please add a short snippet or story if it is really entertaining. The goal is to teach something instead of always telling people "never use macros".


p.s.: I've used macros before... but usually I get rid of them eventually when I have a "real" solution (even if the real solution is inlined so it becomes similar to a macro).


Bonus: Give an example where the macro was really was better than a not-macro solution.

Related question: When are C++ macros beneficial?

© Stack Overflow or respective owner

Related posts about c++

Related posts about c