Thanks a lot for the quick fix!
Wouldn't this implicitly disable cppcheck for the other paths (Q_OS_UNIX and Q_OS_WIN) for the hole project? If I want to avoid this, maybe I could “--inline-suppr” and manually suppress this single warning for this line of the code? This might the better choice for me because I have only one offending line with a theoretically possibly empty container, but I have much more lines in the different code paths which could profit from cppcheck.
Consider the following code: QStringList candidates; ifdef Q_OS_DARWIN candidates.append(QStringLiteral(u"/color/icc/")); elif defined(Q_OS_UNIX) candidates.append(QStringLiteral(u"/color/icc/")); elif defined(Q_OS_WIN) candidates.append(QStringLiteral(u"/color/icc/")); endif int i = 0; for (const QString &path : candidates) { if (path.isEmpty()) { i = i * 3; } } cppcheck now complains: "Iterating over container 'candidates' that is always empty. (CWE-398)" However, 'candidates' is not empty for...
Consider the following code: QByteArray message = QByteArrayLiteral("Test1"); message += QByteArrayLiteral("Test2"); QVERIFY2(2 >= 0, message.constData()); This produces two (!) cppchekc warnings: "Variable 'message' is assigned a value that is never used. (CWE-563)" I would expect no warning at all. Lukas Sommer
Consider the following code: Header: ifndef ASYNCIMAGERENDERTHREAD_H define ASYNCIMAGERENDERTHREAD_H include <qthread.h></qthread.h> class AsyncImageRenderThread : public QThread { public: using pointerToRenderFunction = std::function<void(asyncimagerenderthread &callbackobject)="">; virtual void run() override; std::atomic_bool m_loopAbort = false; const pointerToRenderFunction m_renderFunction; };</void(asyncimagerenderthread> endif // ASYNCIMAGERENDERTHREAD_H Source: include "asyncimagerenderthread.h"...
Hunspell analyse shows sometimes analyzes which are not correct following the defines rules in the dictionary/affix file
If you remove the line ONLYINCOMPOUND o from the affix file, then Hunspell analyzes...
Hunspell correctly recognizes “Arbeitsfundaments” as correct word when operating...
The above bug report was about checking the word “Arbeitsfundaments” (genitiv of...
Hunspell analyse output fails also in some other cases with compounds
By the way: This is a real-world example. The data is an extract of the german de_DE_frami...
Alternatively, you can also modify the dictionary file 2 Arbeits/xoc tt:test1 fundament/z...
If you remove the flag “o” of the last line in the affix file SET ISO8859-1 COMPOUNDBEGIN...
In spell checking mode, Hunspell correctly recognizes “Arbeitsfundament” as correctly...
Hunspell analyse output fails in some cases with compounds