diff options
author | Nikolai Kosjar <nikolai.kosjar@qt.io> | 2016-10-31 15:25:59 +0100 |
---|---|---|
committer | Nikolai Kosjar <nikolai.kosjar@qt.io> | 2016-11-01 10:44:35 +0000 |
commit | a8456c16e89cf7d15d75002cc92698e840692b6e (patch) | |
tree | c1b26def6a87fb3998b6a3a7ff1d2aadb888d781 /src/plugins/cpptools/compileroptionsbuilder.cpp | |
parent | e1921741afbee8163e9a09a080ed8a6a0bf7f24d (diff) | |
download | qt-creator-a8456c16e89cf7d15d75002cc92698e840692b6e.tar.gz |
Clang: Avoid parsing unknown __builtin_va_arg_pack
Task-number: QTCREATORBUG-17185
Change-Id: I72552bcd417c9760413b772593642e3c79f1ab17
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/cpptools/compileroptionsbuilder.cpp')
-rw-r--r-- | src/plugins/cpptools/compileroptionsbuilder.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/plugins/cpptools/compileroptionsbuilder.cpp b/src/plugins/cpptools/compileroptionsbuilder.cpp index a2b2ed3ba6..e07d4fcc56 100644 --- a/src/plugins/cpptools/compileroptionsbuilder.cpp +++ b/src/plugins/cpptools/compileroptionsbuilder.cpp @@ -423,6 +423,16 @@ bool CompilerOptionsBuilder::excludeDefineDirective(const QByteArray &defineDire return true; } + // If _FORTIFY_SOURCE is defined (typically in release mode), it will + // enable the inclusion of extra headers to help catching buffer overflows + // (e.g. wchar.h includes wchar2.h). These extra headers use + // __builtin_va_arg_pack, which clang does not support (yet), so avoid + // including those. + if (m_projectPart.toolchainType == ProjectExplorer::Constants::GCC_TOOLCHAIN_TYPEID + && defineDirective.startsWith("#define _FORTIFY_SOURCE")) { + return true; + } + return false; } |