Examples of errors detected by the V1063 diagnostic

V1063. The modulo by 1 operation is meaningless. The result will always be zero.


LLVM/Clang

V1063 The modulo by 1 operation is meaningless. The result will always be zero. llvm-stress.cpp 631


void Act() override {
  ....
  // If the value type is a vector, and we allow vector select, then in 50%
  // of the cases generate a vector select.
  if (isa<FixedVectorType>(Val0->getType()) && (getRandom() % 1)) {
    unsigned NumElem =
        cast<FixedVectorType>(Val0->getType())->getNumElements();
    CondTy = FixedVectorType::get(CondTy, NumElem);
  }
  ....
}

Qt

V1063 The modulo by 1 operation is meaningless. The result will always be zero. qm.cpp 549


bool loadQM(Translator &translator, QIODevice &dev, ConversionData &cd)
{
  ....
  case Tag_Translation: {
    int len = read32(m);
    if (len % 1) {                                             // <=
      cd.appendError(QLatin1String("QM-Format error"));
      return false;
    }
    m += 4;
    QString str = QString((const QChar *)m, len/2);
  ....
}

MuseScore

V1063 The modulo by 1 operation is meaningless. The result will always be zero. lyrics.h 85


class Lyrics final : public TextBase
{
  ....
  bool isEven() const { return _no % 1; }
  ....
}


Bugs Found

Checked Projects
427
Collected Errors
14 526
This website uses cookies and other technology to provide you a more personalized experience. By continuing the view of our web-pages you accept the terms of using these files. If you don't want your personal data to be processed, please, leave this site. Learn More →
Accept