How to deprecate a macro in GCC?

前端 未结 4 715
醉话见心
醉话见心 2021-01-04 05:20

i Know how to use attribute deprecated to deprecate a function like this:

int old_fn () __attribute__ ((deprecated));

But

4条回答
  •  时光取名叫无心
    2021-01-04 06:00

    Since Macros are not part of the compiler (they are a pre-processor function), there is no clean way of doing this. At best, place your deprecated macros in a new header file filled with #warnings. This will of course break existing code, but its one way to guarantee drawing attention to the deprecation.

提交回复
热议问题