include: Add macro to ignore -Wuser-defined-warnings
authorTsukasa OI <research_trasio@irq.a4lg.com>
Mon, 12 Sep 2022 07:07:49 +0000 (07:07 +0000)
committerTsukasa OI <research_trasio@irq.a4lg.com>
Thu, 22 Sep 2022 10:53:24 +0000 (10:53 +0000)
commitc59ea02cc3cbc89cde1fcb72e4267b73cdaf7f55
treeeb62353b16e0aef85ad41809c87d7b8cf4e88042
parent7abc6ec0a6f7e82bda6f00c1f1ae7c638d1c799c
include: Add macro to ignore -Wuser-defined-warnings

User-defined warnings (on Clang, "-Wuser-defined-warnings") can be harmful
if we have specified "-Werror" and we have no control to disable the warning
ourself.  The particular example is Gnulib.

Gnulib generates a warning if the system version of certain functions
are used (to redirect the developer to use Gnulib version).  However,
it can be harmful if we cannot easily replace them (e.g. the target is in
the standard C++ library).

The new DIAGNOSTIC_IGNORE_USER_DEFINED_WARNINGS macro can be helpful on such
cases.  A typical use of this macro is to place this macro before including
certain system headers.

include/ChangeLog:

* diagnostics.h (DIAGNOSTIC_IGNORE_USER_DEFINED_WARNINGS): New.
include/diagnostics.h