Skip to content

Commit fa5db38

Browse files
committed
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 <[email protected]>
1 parent 35267be commit fa5db38

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

connectivity/source/drivers/file/FDatabaseMetaData.cxx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ Reference< XResultSet > SAL_CALL ODatabaseMetaData::getColumns(
7373

7474
namespace
7575
{
76+
#if !ENABLE_FUZZERS
7677
sal_Int16 isCaseSensitiveParentFolder( const OUString& _rFolderOrDoc, std::u16string_view _rDocName )
7778
{
7879
sal_Int16 nIsCS = 1;
@@ -151,6 +152,7 @@ namespace
151152

152153
return nIsCS;
153154
}
155+
#endif
154156
}
155157

156158

connectivity/source/manager/mdrivermanager.cxx

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ Any SAL_CALL ODriverEnumeration::nextElement( )
102102
return makeAny( *m_aPos++ );
103103
}
104104

105-
namespace {
106-
105+
namespace
106+
{
107107
/// an STL functor which ensures that a SdbcDriver described by a DriverAccess is loaded
108108
struct EnsureDriver
109109
{
@@ -174,9 +174,8 @@ Any SAL_CALL ODriverEnumeration::nextElement( )
174174
}
175175
};
176176

177-
}
178-
179-
static sal_Int32 lcl_getDriverPrecedence( const Reference<XComponentContext>& _rContext, Sequence< OUString >& _rPrecedence )
177+
#if !ENABLE_FUZZERS
178+
sal_Int32 lcl_getDriverPrecedence( const Reference<XComponentContext>& _rContext, Sequence< OUString >& _rPrecedence )
180179
{
181180
_rPrecedence.realloc( 0 );
182181
try
@@ -210,8 +209,7 @@ Any SAL_CALL ODriverEnumeration::nextElement( )
210209

211210
return _rPrecedence.getLength();
212211
}
213-
214-
namespace {
212+
#endif
215213

216214
/// an STL algorithm compatible predicate comparing two DriverAccess instances by their implementation names
217215
struct CompareDriverAccessByName
@@ -234,8 +232,7 @@ Any SAL_CALL ODriverEnumeration::nextElement( )
234232
return lhs.sImplementationName == m_sImplName;
235233
}
236234
};
237-
238-
}
235+
}
239236

240237
OSDBCDriverManager::OSDBCDriverManager( const Reference< XComponentContext >& _rxContext )
241238
:OSDBCDriverManager_Base(m_aMutex)

sc/source/core/data/documen3.cxx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -575,8 +575,11 @@ bool ScDocument::LinkExternalTab( SCTAB& rTab, const OUString& aDocTab,
575575
}
576576
rTab = 0;
577577
#if ENABLE_FUZZERS
578+
(void)aDocTab;
579+
(void)aFileName;
580+
(void)aTabName;
578581
return false;
579-
#endif
582+
#else
580583
OUString aFilterName; // Is filled by the Loader
581584
OUString aOptions; // Filter options
582585
sal_uInt32 nLinkCnt = pExtDocOptions ? pExtDocOptions->GetDocSettings().mnLinkCnt : 0;
@@ -618,6 +621,7 @@ bool ScDocument::LinkExternalTab( SCTAB& rTab, const OUString& aDocTab,
618621
pBindings->Invalidate( SID_LINKS );
619622
}
620623
return true;
624+
#endif
621625
}
622626

623627
ScExternalRefManager* ScDocument::GetExternalRefManager() const

solenv/bin/native-code.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -861,6 +861,7 @@ def limit_rdb(services_rdb, full_factory_map, full_constructor_map):
861861
* File generated by solenv/bin/native-code.py
862862
*/
863863
864+
#include <config_crypto.h>
864865
#include <config_features.h>
865866
#include <config_fuzzers.h>
866867
#include <config_gpgme.h>

0 commit comments

Comments
 (0)