aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/ApiExtractor/clangparser/compilersupport.cpp
diff options
context:
space:
mode:
authorChristian Tismer <tismer@stackless.com>2021-04-11 14:32:09 +0200
committerChristian Tismer <tismer@stackless.com>2021-04-12 14:00:43 +0200
commit59f92c2133ad1d43ba2f6a7a32c5b70fc6aba614 (patch)
tree0835d75b75f357ec682c39ca0ab1ba177f22145e /sources/shiboken6/ApiExtractor/clangparser/compilersupport.cpp
parent416ccd7516ea4f4a5b8419c2fd7de0346c334df1 (diff)
shiboken: get rid of some warnings
A few warnings are from libshiboken: Fix some clang analzyer warnings where const_cast is still needed in Python 3. Thanks for helping with auto writeConversionRegister = [this, &s](const AbstractMetaType &sourceType, const QString &targetTypeName, const QString &targetConverter) Change-Id: I487c9a5234dd1378c3a834076dd3bb204bb76cb8 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'sources/shiboken6/ApiExtractor/clangparser/compilersupport.cpp')
-rw-r--r--sources/shiboken6/ApiExtractor/clangparser/compilersupport.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/sources/shiboken6/ApiExtractor/clangparser/compilersupport.cpp b/sources/shiboken6/ApiExtractor/clangparser/compilersupport.cpp
index 02a66b40e..7631916fb 100644
--- a/sources/shiboken6/ApiExtractor/clangparser/compilersupport.cpp
+++ b/sources/shiboken6/ApiExtractor/clangparser/compilersupport.cpp
@@ -95,7 +95,7 @@ static bool runProcess(const QString &program, const QStringList &arguments,
static QByteArray frameworkPath() { return QByteArrayLiteral(" (framework directory)"); }
-#if defined(Q_OS_MACOS)
+# if defined(Q_OS_MACOS)
static void filterHomebrewHeaderPaths(HeaderPaths &headerPaths)
{
QByteArray homebrewPrefix = qgetenv("HOMEBREW_OPT");
@@ -123,7 +123,7 @@ static void filterHomebrewHeaderPaths(HeaderPaths &headerPaths)
}
}
}
-#endif
+# endif
// Determine g++'s internal include paths from the output of
// g++ -E -x c++ - -v </dev/null
@@ -161,9 +161,9 @@ static HeaderPaths gppInternalIncludePaths(const QString &compiler)
}
}
-#if defined(Q_OS_MACOS)
+# if defined(Q_OS_MACOS)
filterHomebrewHeaderPaths(result);
-#endif
+# endif
return result;
}
#endif // Q_CC_MSVC
@@ -300,7 +300,7 @@ static QString compilerFromCMake(const QString &defaultCompiler)
{
// Added !defined(Q_OS_DARWIN) due to PYSIDE-1032
# if defined(CMAKE_CXX_COMPILER) && !defined(Q_OS_DARWIN)
- Q_UNUSED(defaultCompiler)
+ Q_UNUSED(defaultCompiler);
return QString::fromLocal8Bit(CMAKE_CXX_COMPILER);
# else
return defaultCompiler;
@@ -329,6 +329,11 @@ static void appendClangBuiltinIncludes(HeaderPaths *p)
// Returns clang options needed for emulating the host compiler
QByteArrayList emulatedCompilerOptions()
{
+#if defined(Q_CC_GNU)
+ // Needed to silence a warning, but needsGppInternalHeaders is used below.
+ // This seems to be a compiler bug on macOS.
+ Q_UNUSED(needsGppInternalHeaders);
+#endif
QByteArrayList result;
#if defined(Q_CC_MSVC)
HeaderPaths headerPaths;