connectivity/source/drivers/file/FDatabaseMetaData.cxx |    2 ++
 connectivity/source/manager/mdrivermanager.cxx         |   15 ++++++---------
 sc/source/core/data/documen3.cxx                       |    6 +++++-
 solenv/bin/native-code.py                              |    1 +
 4 files changed, 14 insertions(+), 10 deletions(-)

New commits:
commit 6662eec377c02290de369f8a4f1a385d9f13352a
Author:     Jan-Marek Glogowski <glo...@fbihome.de>
AuthorDate: Fri Dec 24 02:37:33 2021 +0100
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Fri Apr 22 15:09:49 2022 +0200

    oss-fuzz: fix some compiler warnings
    
    Some unused functions and variables and many missing
    HAVE_FEATURE_NSS warnings, because the native-code.py
    stubs were missing the config_crypto.h header.
    
    Change-Id: I88ff7d8f96e7382027a21f205db982fd797bd6af
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127392
    Tested-by: Jenkins
    Reviewed-by: Jan-Marek Glogowski <glo...@fbihome.de>
    (cherry picked from commit fa5db38ae5bbe9abfd41b6765074ca1200b8def2)

diff --git a/connectivity/source/drivers/file/FDatabaseMetaData.cxx 
b/connectivity/source/drivers/file/FDatabaseMetaData.cxx
index f6480744e665..6d0a4f2fe0b1 100644
--- a/connectivity/source/drivers/file/FDatabaseMetaData.cxx
+++ b/connectivity/source/drivers/file/FDatabaseMetaData.cxx
@@ -73,6 +73,7 @@ Reference< XResultSet > SAL_CALL 
ODatabaseMetaData::getColumns(
 
 namespace
 {
+#if !ENABLE_FUZZERS
     sal_Int16 isCaseSensitiveParentFolder( const OUString& _rFolderOrDoc, 
std::u16string_view _rDocName )
     {
         sal_Int16 nIsCS = 1;
@@ -151,6 +152,7 @@ namespace
 
         return nIsCS;
     }
+#endif
 }
 
 
diff --git a/connectivity/source/manager/mdrivermanager.cxx 
b/connectivity/source/manager/mdrivermanager.cxx
index bef3c8d74eaa..6bf98cab693e 100644
--- a/connectivity/source/manager/mdrivermanager.cxx
+++ b/connectivity/source/manager/mdrivermanager.cxx
@@ -102,8 +102,8 @@ Any SAL_CALL ODriverEnumeration::nextElement(  )
     return makeAny( *m_aPos++ );
 }
 
-    namespace {
-
+namespace
+{
     /// an STL functor which ensures that a SdbcDriver described by a 
DriverAccess is loaded
     struct EnsureDriver
     {
@@ -174,9 +174,8 @@ Any SAL_CALL ODriverEnumeration::nextElement(  )
         }
     };
 
-    }
-
-    static sal_Int32 lcl_getDriverPrecedence( const 
Reference<XComponentContext>& _rContext, Sequence< OUString >& _rPrecedence )
+#if !ENABLE_FUZZERS
+    sal_Int32 lcl_getDriverPrecedence( const Reference<XComponentContext>& 
_rContext, Sequence< OUString >& _rPrecedence )
     {
         _rPrecedence.realloc( 0 );
         try
@@ -210,8 +209,7 @@ Any SAL_CALL ODriverEnumeration::nextElement(  )
 
         return _rPrecedence.getLength();
     }
-
-    namespace {
+#endif
 
     /// an STL argorithm compatible predicate comparing two DriverAccess 
instances by their implementation names
     struct CompareDriverAccessByName
@@ -234,8 +232,7 @@ Any SAL_CALL ODriverEnumeration::nextElement(  )
             return lhs.sImplementationName == m_sImplName;
         }
     };
-
-    }
+}
 
 OSDBCDriverManager::OSDBCDriverManager( const Reference< XComponentContext >& 
_rxContext )
     :OSDBCDriverManager_Base(m_aMutex)
diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index 420befae37d2..930539455ead 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -575,8 +575,11 @@ bool ScDocument::LinkExternalTab( SCTAB& rTab, const 
OUString& aDocTab,
     }
     rTab = 0;
 #if ENABLE_FUZZERS
+    (void)aDocTab;
+    (void)aFileName;
+    (void)aTabName;
     return false;
-#endif
+#else
     OUString  aFilterName; // Is filled by the Loader
     OUString  aOptions; // Filter options
     sal_uInt32 nLinkCnt = pExtDocOptions ? 
pExtDocOptions->GetDocSettings().mnLinkCnt : 0;
@@ -618,6 +621,7 @@ bool ScDocument::LinkExternalTab( SCTAB& rTab, const 
OUString& aDocTab,
             pBindings->Invalidate( SID_LINKS );
     }
     return true;
+#endif
 }
 
 ScExternalRefManager* ScDocument::GetExternalRefManager() const
diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index be0802de9a32..b1a006e6b701 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -854,6 +854,7 @@ print ("""/*
  * File generated by solenv/bin/native-code.py
  */
 
+#include <config_crypto.h>
 #include <config_features.h>
 #include <config_fuzzers.h>
 #include <config_gpgme.h>

Reply via email to