@rparon said in uninitialized data passed to QStringList QCoreApplication::arguments():
const char* argv[] = {"MyDll"," "," "};
qapp_pt = cv_new QGuiApplication(argc, (char**) argv);
This is always the wrong thing to do. This code is telling the compiler to allocate something as const, and then instructing it to ignore the const-ness when passing to a function that has a type signature allowing modification.
Quoting from the above link:
Such object cannot be modified: attempt to do so directly is a compile-time error, and attempt to do so indirectly (e.g., by modifying the const object through a reference or pointer to non-const type) results in undefined behavior.
https://en.cppreference.com/w/cpp/language/ub.html
undefined behavior - There are no restrictions on the behavior of the program.
Some examples of undefined behavior are data races, memory accesses outside of array bounds, signed integer overflow, null pointer dereference, more than one modifications of the same scalar in an expression without any intermediate sequence point(until C++11)that is unsequenced(since C++11), access to an object through a pointer of a different type, etc.
Furthermore, the QGuiApplication, the documentation explicitly mentions the possibility of modification:
Note: argc and argv might be changed as Qt removes command line arguments that it recognizes.