i Know how to use attribute deprecated to deprecate a function like this:
int old_fn () __attribute__ ((deprecated));
But
You could make sure that these macros would expand to something that would include a expression that would trigger the __attribute__((deprecated))
warning.
For function-like macros this is pretty easy (especially with the comma operator), but for constant defines or nonstandard macros this may be more complicated, since the context in which these expand is different. I think you could do:
#define DEPRECATE(name) static inline void __attribute__((deprecated)) deprecate_ ## name (void) { ; }
...
#define MAX(x, y) (DEPRECATE(MAX), x>y?x:y)
// yeah, yeah, it repeats args in the body, but it's just an example
For a constant define you probably want to assume that the body has to evaluate without having to generate code, such as outside of a function body, in the targets of a switch/case, or as the initial value of a static variable within a function.
This is tricky, but you may be able to do it for many things.
I wish that C had a __builtin_warn(const char *)
that would work at the compiler level (not-preprocessor) and make things like this easier.
For constant defines you can do:
#define THREE (DEPRICATED(THREE),3)