Here are a few examples:
#define del(X) new X.type(X)
#define del(X) anything
#define #undef #define
#undef #define
#define #warn #error
#define #error #warn
#define something #define
#define something #undef
Either of the following would be helpful:
A: Throw a compile error whenever a pre-processor directive cannot be executed (or fails a sanity check), eg:
error: unreasonable macro definition (programmer intoxicated?)
B: Allow these sorts of definitions. What's the worst that could happen?
P.S. The DMpp will happily #define __FILE__, __LINE__, and/or __MAIN__. Maybe this should trigger a warning?
I don't actually see anything problematic about any of the above. What would be the point in limiting the preprocessor's functionality rather than expanding it?
As far as the risk of strange errors, chalk that up to the ordinary risk any programmer takes on when they try to take the reins at such a low level.