For all but the simplest token replacements and helper functions, macros can be problematic. If you must use macros, here's some things to keep in mind, as well as why you should do them.
Surround each term of a macro's expansion with parentheses
// Example violation:
#define TWICE(x) x * 2 // Wrong!
// Consequences:
TWICE(3 + 5) // This is "3 + 5 * 2" = 13, not 16.
Surround the whole macro expansion with parentheses
// Example violation:
#define TWICE(x) (x) * 2 // Still wrong!
// Consequences:
10 / TWICE(5) // This expression yields 4 ("10 / 5 * 2"), not 1.
Beware of macros that create multiple sequence points
// Example violation:
#define SQUARE(x) ((x) * (x)) // Fine on the surface, but some inputs could be bad...
// Consequences:
int a = 5;
SQUARE(++a); // Uh-oh! Undefined behavior.
Avoid conditional expressions in macros
// Example violation:
#define SAFE_DELETE(p) if(p) delete (p), ((p) = 0) // All kinds of horrible.
// Consequences:
if (resourcesFinished)
SAFE_DELETE(s); // Kablammo! Not bracketed, so the "else" is useless here.
else // Also not a good idea for other reasons (what if p's not
return 0; // a pointer?).
Avoid multiple statements in macros
#define SAFE_DELETE(p) delete (x); (x) = 0
char* s = new char [...];
...
SAFE_DELETE(s); // This works.
if (some_condition) SAFE_DELETE(s); // Kablammo!
// Second macro statement is always evaluated.