diff options
author | Stephan Bergmann <stephan.bergmann@allotropia.de> | 2024-03-26 09:52:24 +0100 |
---|---|---|
committer | Stephan Bergmann <stephan.bergmann@allotropia.de> | 2024-03-26 13:56:20 +0100 |
commit | 66be0576a6202354bd5dce289eb823256cc0a324 (patch) | |
tree | a6e4886f3cab664a399ad2a49e311e934a7ec5c6 | |
parent | 645a7ae67743dc9c35ee91714beefe60d0165bfe (diff) |
Silence -Wdeprecated-pragma
...as seen with recent LLVM 19 trunk on macOS now,
> In file included from sal/osl/unx/uunxapi.mm:1:
> sal/osl/unx/uunxapi.cxx:612:14: error: macro 'ENOSTR' has been marked as deprecated: ENOSTR is deprecated in ISO C++ [-Werror,-Wdeprecated-pragma]
> 612 | case ENOSTR:
> | ^
> ~/llvm/inst/bin/../include/c++/v1/cerrno:48:69: note: macro marked 'deprecated' here
> 48 | # pragma clang deprecated(ENOSTR, "ENOSTR is deprecated in ISO C++")
> | ^
etc. (And -Wdeprecated-pragma was only added towards Clang 14 with
<https://github.com/llvm/llvm-project/commit/26c695b7893071d5e69afbaa70c4850ab2e468be>
"Support macro deprecation #pragma clang deprecated", so wrap it in
__has_warning.)
Change-Id: I8db1f00a48bb647573d287c3410137182570f82b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165304
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
-rw-r--r-- | sal/osl/unx/uunxapi.cxx | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/sal/osl/unx/uunxapi.cxx b/sal/osl/unx/uunxapi.cxx index 033b1a435a77..37db3c987315 100644 --- a/sal/osl/unx/uunxapi.cxx +++ b/sal/osl/unx/uunxapi.cxx @@ -609,13 +609,57 @@ std::string UnixErrnoString(int nErrno) case EBFONT: return "EBFONT"; #endif +#if defined __clang__ +#if __has_warning("-Wdeprecated-pragma") +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-pragma" +#endif +#endif case ENOSTR: +#if defined __clang__ +#if __has_warning("-Wdeprecated-pragma") +#pragma clang diagnostic push +#endif +#endif return "ENOSTR"; +#if defined __clang__ +#if __has_warning("-Wdeprecated-pragma") +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-pragma" +#endif +#endif case ENODATA: +#if defined __clang__ +#if __has_warning("-Wdeprecated-pragma") +#pragma clang diagnostic push +#endif +#endif return "ENODATA"; +#if defined __clang__ +#if __has_warning("-Wdeprecated-pragma") +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-pragma" +#endif +#endif case ETIME: +#if defined __clang__ +#if __has_warning("-Wdeprecated-pragma") +#pragma clang diagnostic push +#endif +#endif return "ETIME"; +#if defined __clang__ +#if __has_warning("-Wdeprecated-pragma") +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-pragma" +#endif +#endif case ENOSR: +#if defined __clang__ +#if __has_warning("-Wdeprecated-pragma") +#pragma clang diagnostic push +#endif +#endif return "ENOSR"; #ifdef ENONET case ENONET: |