]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MINOR: compiler: define a __attribute__warning() macro
authorWilly Tarreau <w@1wt.eu>
Fri, 7 Apr 2023 12:54:36 +0000 (14:54 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 7 Apr 2023 16:14:28 +0000 (18:14 +0200)
commitd4991271486975b245e4607d535b2e4b662981fc
tree4b6d151fea2c56f6f37687da0b6f4f99f2f98378
parent988e19c60715f8f19a9ecee8fbf647bf9d846c95
MINOR: compiler: define a __attribute__warning() macro

__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
include/haproxy/compiler.h