GCC: Disable the -Wmissing-field-initializers in GCC 4
Perfectly valid C++11 code trying to default-initialize an object with {} is being warned. GCC 5 and up only warn if you initialize some fields and not others. qcborvalue.h:68:25: error: missing initializer for member 'QCborError::c' [-Werror=missing-field-initializers] QCborError error = {}; ^ Task-number: QTBUG-68889 Change-Id: I6efb28c3145047559ec0fffd1538577de250e283 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Liang Qi <liang.qi@qt.io>
This commit is contained in:
parent
467c112d12
commit
6a89f89946
@ -81,6 +81,8 @@ clang {
|
||||
}
|
||||
} else: gcc:!intel_icc {
|
||||
QMAKE_CXXFLAGS_WARN_ON += -Wvla
|
||||
# GCC 5 fixed -Wmissing-field-initializers for when there are no initializers
|
||||
lessThan(QT_GCC_MAJOR_VERSION, 5): QMAKE_CXXFLAGS_WARN_ON += -Wno-missing-field-initializers
|
||||
# GCC 5 introduced -Wdate-time
|
||||
greaterThan(QT_GCC_MAJOR_VERSION, 4): QMAKE_CXXFLAGS_WARN_ON += -Wdate-time
|
||||
# GCC 6 introduced these
|
||||
|
Loading…
Reference in New Issue
Block a user