merly-ai / MP-CodeCheckBin-Ubuntu

MP-CodeCheck Binary Ubuntu Release
GNU General Public License v3.0
3 stars 1 forks source link

Bugs not captured by MP-CC #2

Open naren-nallapareddy opened 2 years ago

naren-nallapareddy commented 2 years ago

Hi,

I am trying to use MP-CodeCheck to find some bugs in code that are intentionally placed. I have example C++ code here:

#include` <iostream>

using namespace std;

int main(int argc, char* argv[]) {
  int num = argc - 1;

  if (num == 0) {
    cout << "No arguments provided\n";
  } else if (num == 0) { // intentional mistake
    cout << "1 argument provided\n";
  } else if (num = 2) { // intentional mistake
    cout << "2 arguments provided\n";
  } else {
    cout << num << " arguments provided\n";
  }
  if (argv != 0) {
    cout << "argv not null\n";;// intentional mistake
  }
  if (argv == nullptr) {
    return **argv; // intentional mistake
  }

  return 0;
}

I see no anomalies detected in MP-CodeCheck, is this expected behaviour? Capture