summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-03-26 12:58:23 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-03-26 15:10:33 +0000
commitdbc983a513a6dff9973490d013b144812ec707aa (patch)
treeb75055ff2750ac0035c186ea817c53cb653e1bbe
parentedf96b984d406cb7c00eb83f1b7e8588ac663c1f (diff)
Revert "Detect C standard and try using the most recent"
The change causes a crash when compiling the xkbcommon 3rdparty library and compile failures (qtimageformats on Android). This reverts commit a47cb146809e32f43449dcfe9932833c2f0ab987. Task-number: QTBUG-67326 Task-number: QTBUG-67327 Change-Id: I5ddc4eccad699e3eaec535fd6a63d11b0026b42e Reviewed-by: Sami Nurmenniemi <sami.nurmenniemi@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Gatis Paeglis <gatis.paeglis@qt.io>
-rw-r--r--configure.json48
-rw-r--r--mkspecs/common/android-base-tail.conf2
-rw-r--r--mkspecs/common/clang.conf2
-rw-r--r--mkspecs/common/g++-base.conf2
-rw-r--r--mkspecs/common/gcc-base.conf3
-rw-r--r--mkspecs/features/default_post.prf15
-rw-r--r--mkspecs/features/qt_common.prf2
-rw-r--r--mkspecs/features/qt_configure.prf13
-rw-r--r--src/3rdparty/xkbcommon.pri1
-rw-r--r--src/corelib/global/qcompilerdetection.h2
10 files changed, 4 insertions, 86 deletions
diff --git a/configure.json b/configure.json
index b4d763116c..ae2aa22070 100644
--- a/configure.json
+++ b/configure.json
@@ -259,36 +259,6 @@
"type": "compile",
"test": "stl"
},
- "c99": {
- "label": "C99 support",
- "type": "compile",
- "test": {
- "head": [
- "#if __STDC_VERSION__ >= 199901L",
- "// Compiler claims to support C99, trust it",
- "#else",
- "# error __STDC_VERSION__ must be >= 199901L",
- "#endif"
- ],
- "lang": "c",
- "qmake": "CONFIG += c99"
- }
- },
- "c11": {
- "label": "C11 support",
- "type": "compile",
- "test": {
- "head": [
- "#if __STDC_VERSION__ >= 201112L",
- "// Compiler claims to support C11, trust it",
- "#else",
- "# error __STDC_VERSION__ must be >= 201112L",
- "#endif"
- ],
- "lang": "c",
- "qmake": "CONFIG += c11"
- }
- },
"c++14": {
"label": "C++14 support",
"type": "compile",
@@ -816,19 +786,6 @@
"condition": "features.c++14 && tests.c++1z",
"output": [ "publicFeature", "publicQtConfig" ]
},
- "c89": {
- "label": "C89"
- },
- "c99": {
- "label": "C99",
- "condition": "tests.c99",
- "output": [ "publicFeature" ]
- },
- "c11": {
- "label": "C11",
- "condition": "features.c99 && tests.c11",
- "output": [ "publicFeature" ]
- },
"precompile_header": {
"label": "Using precompiled headers",
"condition": "config.msvc || tests.precompile_header",
@@ -1290,11 +1247,6 @@ Configure with '-qreal float' to create a build that is binary-compatible with 5
},
"shared",
{
- "message": "Using C standard",
- "type": "firstAvailableFeature",
- "args": "c11 c99 c89"
- },
- {
"message": "Using C++ standard",
"type": "firstAvailableFeature",
"args": "c++1z c++14 c++11"
diff --git a/mkspecs/common/android-base-tail.conf b/mkspecs/common/android-base-tail.conf
index 464b60b1c4..160caf011f 100644
--- a/mkspecs/common/android-base-tail.conf
+++ b/mkspecs/common/android-base-tail.conf
@@ -38,8 +38,6 @@ QMAKE_CFLAGS_THREAD = -D_REENTRANT
QMAKE_CFLAGS_HIDESYMS = -fvisibility=hidden
QMAKE_CFLAGS_NEON = -mfpu=neon
-QMAKE_CFLAGS_GNUC99 = -std=gnu99
-QMAKE_CFLAGS_GNUC11 = -std=gnu11
QMAKE_CXXFLAGS_CXX11 = -std=c++11
QMAKE_CXXFLAGS_CXX14 = -std=c++14
QMAKE_CXXFLAGS_CXX1Z = -std=c++1z
diff --git a/mkspecs/common/clang.conf b/mkspecs/common/clang.conf
index 6122a37213..e003b947aa 100644
--- a/mkspecs/common/clang.conf
+++ b/mkspecs/common/clang.conf
@@ -21,8 +21,6 @@ QMAKE_CFLAGS_PRECOMPILE = -x c-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_
QMAKE_CFLAGS_USE_PRECOMPILE = -Xclang -include-pch -Xclang ${QMAKE_PCH_OUTPUT}
QMAKE_CFLAGS_LTCG = -flto
QMAKE_CFLAGS_DISABLE_LTCG = -fno-lto
-QMAKE_CFLAGS_GNUC99 = -std=gnu99
-QMAKE_CFLAGS_GNUC11 = -std=gnu11
QMAKE_CXXFLAGS_PRECOMPILE = -x c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT}
QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
diff --git a/mkspecs/common/g++-base.conf b/mkspecs/common/g++-base.conf
index fa0f0c391d..c42c46b0ec 100644
--- a/mkspecs/common/g++-base.conf
+++ b/mkspecs/common/g++-base.conf
@@ -27,8 +27,6 @@ QMAKE_CFLAGS_USE_PRECOMPILE = -include ${QMAKE_PCH_OUTPUT_BASE}
QMAKE_CXXFLAGS_PRECOMPILE = -x c++-header -c ${QMAKE_PCH_INPUT} -o ${QMAKE_PCH_OUTPUT}
QMAKE_CXXFLAGS_USE_PRECOMPILE = $$QMAKE_CFLAGS_USE_PRECOMPILE
-QMAKE_CFLAGS_GNUC99 = -std=gnu99
-QMAKE_CFLAGS_GNUC11 = -std=gnu11
QMAKE_CXXFLAGS_CXX11 = -std=c++11
QMAKE_CXXFLAGS_CXX14 = -std=c++1y
QMAKE_CXXFLAGS_CXX1Z = -std=c++1z
diff --git a/mkspecs/common/gcc-base.conf b/mkspecs/common/gcc-base.conf
index 0407ba9724..234f71d495 100644
--- a/mkspecs/common/gcc-base.conf
+++ b/mkspecs/common/gcc-base.conf
@@ -81,9 +81,6 @@ QMAKE_LFLAGS_RELEASE_WITH_DEBUGINFO +=
QMAKE_LFLAGS_EXCEPTIONS_OFF +=
QMAKE_LFLAGS_LTCG = $$QMAKE_CFLAGS_LTCG -fuse-linker-plugin
-QMAKE_CFLAGS_C99 = -std=c99
-QMAKE_CFLAGS_C11 = -std=c11
-
QMAKE_CFLAGS_SSE2 += -msse2
QMAKE_CFLAGS_SSE3 += -msse3
QMAKE_CFLAGS_SSSE3 += -mssse3
diff --git a/mkspecs/features/default_post.prf b/mkspecs/features/default_post.prf
index bf5acdefc4..9eba5bcf00 100644
--- a/mkspecs/features/default_post.prf
+++ b/mkspecs/features/default_post.prf
@@ -143,21 +143,6 @@ c++11|c++14|c++1z {
unset(cxxstd)
}
-c99|c11 {
- c11: cstd = C11
- else: cstd = C99
-
- # Check if we should disable compiler extensions or not
- !isEmpty(QMAKE_CFLAGS_GNU$$cstd) {
- # Let strict C++ imply strict C
- !strict_c++: cstd = GNU$$cstd
- }
-
- QMAKE_CFLAGS += $$eval(QMAKE_CFLAGS_$$cstd)
-
- unset(cstd)
-}
-
utf8_source {
QMAKE_CFLAGS += $$QMAKE_CFLAGS_UTF8_SOURCE
QMAKE_CXXFLAGS += $$QMAKE_CFLAGS_UTF8_SOURCE
diff --git a/mkspecs/features/qt_common.prf b/mkspecs/features/qt_common.prf
index 40f03d2186..f4ae5bde80 100644
--- a/mkspecs/features/qt_common.prf
+++ b/mkspecs/features/qt_common.prf
@@ -17,8 +17,6 @@ DEFINES *= QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
qtConfig(c++11): CONFIG += c++11 strict_c++
qtConfig(c++14): CONFIG += c++14
qtConfig(c++1z): CONFIG += c++1z
-qtConfig(c99): CONFIG += c99
-qtConfig(c11): CONFIG += c11
qtConfig(stack-protector-strong): CONFIG += stack_protector_strong
contains(TEMPLATE, .*lib) {
# module and plugins
diff --git a/mkspecs/features/qt_configure.prf b/mkspecs/features/qt_configure.prf
index a7da26c745..98fff59ea1 100644
--- a/mkspecs/features/qt_configure.prf
+++ b/mkspecs/features/qt_configure.prf
@@ -866,15 +866,6 @@ defineTest(qtConfTestPrepare_compile) {
defineTest(qtConfPrepareCompileTestSource) {
test_dir = $$2
- test_lang = $$eval($${1}.lang)
- isEmpty(test_lang): test_lang = "c++"
-
- equals(test_lang, "c++"): suffix = "cpp"
- else: equals(test_lang, "c"): suffix = "c"
- else: equals(test_lang, "objc"): suffix = "m"
- else: equals(test_lang, "objc++"): suffix = "mm"
- else: error("Unknown language '$$test_lang' in compile test $$1")
-
# Create source code
contents = "/* Generated by configure */"
# Custom code before includes
@@ -898,10 +889,10 @@ defineTest(qtConfPrepareCompileTestSource) {
" /* END TEST */" \
" return 0;" \
"}"
- write_file($$test_dir/main.$$suffix, contents)|error()
+ write_file($$test_dir/main.cpp, contents)|error()
# Create stub .pro file
- contents = "SOURCES = main.$$suffix"
+ contents = "SOURCES = main.cpp"
# Custom project code
for (ent, $$qtConfScalarOrList($${1}.qmake)): \
contents += $$ent
diff --git a/src/3rdparty/xkbcommon.pri b/src/3rdparty/xkbcommon.pri
index 1050e54f3a..1d953d8372 100644
--- a/src/3rdparty/xkbcommon.pri
+++ b/src/3rdparty/xkbcommon.pri
@@ -1,3 +1,4 @@
+QMAKE_CFLAGS += -std=gnu99 -w
INCLUDEPATH += $$PWD/xkbcommon \
$$PWD/xkbcommon/xkbcommon \
$$PWD/xkbcommon/src \
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index e5e47082d8..f3f3139d1a 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -898,7 +898,7 @@
/* C11 features supported in GCC 4.7: */
# define Q_COMPILER_STATIC_ASSERT
# endif
-# if Q_CC_GNU >= 409 && defined(__has_include)
+# if Q_CC_GNU >= 409
/* C11 features supported in GCC 4.9: */
# if __has_include(<threads.h>)
# define Q_COMPILER_THREAD_LOCAL