sal/osl/unx/uunxapi.cxx |   44 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

New commits:
commit 66be0576a6202354bd5dce289eb823256cc0a324
Author:     Stephan Bergmann <stephan.bergm...@allotropia.de>
AuthorDate: Tue Mar 26 09:52:24 2024 +0100
Commit:     Stephan Bergmann <stephan.bergm...@allotropia.de>
CommitDate: Tue Mar 26 13:56:20 2024 +0100

    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.bergm...@allotropia.de>

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
@@ -608,14 +608,58 @@ std::string UnixErrnoString(int nErrno)
 #ifdef EBFONT
         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:

Reply via email to