Our website uses cookies to enhance your browsing experience.
Accept
to the top
>
>
>
Examples of errors detected by the V106…

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; }
  ....
}

GZDoom

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


void SWPalDrawers::DrawUnscaledFuzzColumn(const SpriteDrawerArgs& args)
{
  ....
  int fuzzstep = 1;
  int fuzz = _fuzzpos % FUZZTABLE;

  #ifndef ORIGINAL_FUZZ

  while (count > 0)
  {
    int available = (FUZZTABLE - fuzz);
    int next_wrap = available / fuzzstep;
    if (available % fuzzstep != 0)             // <=
      next_wrap++;
    ....
  }
  ....
}

Xenia

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


void Win32X64CodeCache::InitializeUnwindEntry(....)
{
  ....
  if (unwind_info->CountOfCodes % 1)
  {
    // Count of unwind codes must always be even.
    std::memset(&unwind_info->UnwindCode[unwind_info->CountOfCodes + 1], 0,
                sizeof(UNWIND_CODE));
    ....
  }
  ....
}

close form

Fill out the form in 2 simple steps below:

Your contact information:

Step 1
Congratulations! This is your promo code!

Desired license type:

Step 2
Team license
Enterprise license
** By clicking this button you agree to our Privacy Policy statement
close form
Request our prices
New License
License Renewal
--Select currency--
USD
EUR
* By clicking this button you agree to our Privacy Policy statement

close form
Free PVS‑Studio license for Microsoft MVP specialists
* By clicking this button you agree to our Privacy Policy statement

close form
To get the licence for your open-source project, please fill out this form
* By clicking this button you agree to our Privacy Policy statement

close form
I am interested to try it on the platforms:
* By clicking this button you agree to our Privacy Policy statement

close form
check circle
Message submitted.

Your message has been sent. We will email you at


If you do not see the email in your inbox, please check if it is filtered to one of the following folders:

  • Promotion
  • Updates
  • Spam