[Libreoffice-commits] core.git: connectivity/source solenv/gbuild ucbhelper/source

Stephan Bergmann (via logerrit) logerrit at kemper.freedesktop.org
Thu Aug 20 20:28:32 UTC 2020


 connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx |    6 ++----
 connectivity/source/sdbcx/VCollection.cxx                      |    5 ++---
 solenv/gbuild/gbuild.mk                                        |    1 -
 ucbhelper/source/client/content.cxx                            |    7 ++-----
 4 files changed, 6 insertions(+), 13 deletions(-)

New commits:
commit 7281c497dec340efbcef330d88b55bcabefb8147
Author:     Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Thu Aug 20 21:26:13 2020 +0200
Commit:     Stephan Bergmann <sbergman at redhat.com>
CommitDate: Thu Aug 20 22:27:48 2020 +0200

    Use OSL_UNREACHABLE
    
    ...in those places that used some code conditional on ENABLE_LTO to work around
    (non-)unreachability wranings.  This removes all uses of the ENABLE_LTO C/C++
    macro, so it can go completely.
    
    Change-Id: I67544986cb2d3fcd8051caf87c5129bd1086408c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101087
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx b/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx
index 969a1f1e1f4f..ffc0feb75a8b 100644
--- a/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx
+++ b/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx
@@ -29,6 +29,7 @@
 #include <cppuhelper/implementationentry.hxx>
 #include <cppuhelper/supportsservice.hxx>
 #include <connectivity/dbexception.hxx>
+#include <o3tl/unreachable.hxx>
 #include <TConnection.hxx>
 
 using namespace connectivity;
@@ -169,10 +170,7 @@ sal_Int32 SAL_CALL ODatabaseMetaDataResultSet::findColumn( const OUString& colum
     }
 
     ::dbtools::throwInvalidColumnException( columnName, *this );
-#if !(defined(_MSC_VER) && defined(ENABLE_LTO))
-    assert(false);
-    return 0; // Never reached
-#endif
+    O3TL_UNREACHABLE;
 }
 
 void ODatabaseMetaDataResultSet::checkIndex(sal_Int32 columnIndex )
diff --git a/connectivity/source/sdbcx/VCollection.cxx b/connectivity/source/sdbcx/VCollection.cxx
index d7a716a59839..860ead949074 100644
--- a/connectivity/source/sdbcx/VCollection.cxx
+++ b/connectivity/source/sdbcx/VCollection.cxx
@@ -30,6 +30,7 @@
 #include <comphelper/property.hxx>
 #include <comphelper/servicehelper.hxx>
 #include <cppuhelper/exc_hlp.hxx>
+#include <o3tl/unreachable.hxx>
 #include <TConnection.hxx>
 #include <strings.hrc>
 #include <resource/sharedresources.hxx>
@@ -434,9 +435,7 @@ sal_Int32 SAL_CALL OCollection::findColumn( const OUString& columnName )
     if ( !m_pElements->exists(columnName) )
     {
         ::dbtools::throwInvalidColumnException( columnName, static_cast< XIndexAccess*>(this) );
-#if !(defined(_MSC_VER) && defined(ENABLE_LTO))
-        assert(false);
-#endif
+        O3TL_UNREACHABLE;
     }
 
     return m_pElements->findColumn(columnName) + 1; // because columns start at one
diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk
index 64ca8184e2fa..999f5f79fa37 100644
--- a/solenv/gbuild/gbuild.mk
+++ b/solenv/gbuild/gbuild.mk
@@ -251,7 +251,6 @@ endif
 gb_GLOBALDEFS += \
 	$(call gb_Helper_define_if_set,\
 		DISABLE_DYNLOADING \
-		ENABLE_LTO \
 	)
 
 gb_GLOBALDEFS := $(sort $(gb_GLOBALDEFS))
diff --git a/ucbhelper/source/client/content.cxx b/ucbhelper/source/client/content.cxx
index 8d01366d3ffc..887658755be8 100644
--- a/ucbhelper/source/client/content.cxx
+++ b/ucbhelper/source/client/content.cxx
@@ -21,6 +21,7 @@
 
 #include <cassert>
 
+#include <o3tl/unreachable.hxx>
 #include <osl/diagnose.h>
 #include <osl/mutex.hxx>
 #include <sal/log.hxx>
@@ -1013,11 +1014,7 @@ bool Content::isFolder()
                     get() ) ),
          m_xImpl->getEnvironment() );
 
-#if !(defined(_MSC_VER) && defined(ENABLE_LTO))
-    // Unreachable - cancelCommandExecution always throws an exception.
-    // But some compilers complain...
-    return false;
-#endif
+    O3TL_UNREACHABLE;
 }
 
 


More information about the Libreoffice-commits mailing list