diff --git a/cfg/qt.cfg b/cfg/qt.cfg index 8aecd9edd..9c5c95324 100644 --- a/cfg/qt.cfg +++ b/cfg/qt.cfg @@ -3561,6 +3561,18 @@ + + + + false + + + + + + + + @@ -3664,6 +3676,27 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/test/cfg/qt.cpp b/test/cfg/qt.cpp index 1f2bf6316..b0edfe3cb 100644 --- a/test/cfg/qt.cpp +++ b/test/cfg/qt.cpp @@ -44,6 +44,26 @@ QString::iterator QString3() return it; } +void QByteArray1(QByteArray byteArrayArg) +{ + for (int i = 0; i <= byteArrayArg.size(); ++i) { + // cppcheck-suppress stlOutOfBounds + byteArrayArg[i] = 'x'; + } + + // cppcheck-suppress containerOutOfBoundsIndexExpression + byteArrayArg[byteArrayArg.length()] = 'a'; + // cppcheck-suppress containerOutOfBoundsIndexExpression + byteArrayArg[byteArrayArg.count()] = 'b'; + // cppcheck-suppress containerOutOfBoundsIndexExpression + printf("val: %c\n", byteArrayArg[byteArrayArg.size()]); + + QByteArray byteArray1{'a', 'b'}; + (void)byteArray1[1]; + // cppcheck-suppress ignoredReturnValue + byteArray1.at(1); +} + void QList1(QList intListArg) { for (int i = 0; i <= intListArg.size(); ++i) {