mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-01-19 00:51:37 +01:00
__attribute__((deprecated)) is convenient to discourage from using something deprecated, but gcc >= 4.3 provides __attribute__((warning(x))) that allows to display a specific warning if something is used. This is particularly convenient to give indications when some API parts need to be adapted. Let's just define it as a macro that falls back to the older deprecated attribute when not available. It's supported on clang 14 as well but works differently and errors out when redefined (while the main purpose precisely is to add such a redefinition). Thus instead on clang we use deprecated(msg) which is OK. See https://github.com/llvm/llvm-project/issues/56519