arithOperationsOnVoidPointer
Best practice
Warning
Avoid arithmetic operation on void pointers
C and C++ are really performant languages and can be very error-prone. We all had core dumps and made pointer arithmetic errors! Thankfully, Codiga has hundreds of static analysis rules to flag potential errors in your C/C++ code, automate code reviews and merge with confidence.
Avoid arithmetic operation on void pointers
Assigning a pointer to an integer is not portable.
Returning an integer in a function with pointer return type is not portable.
Invalid pointer cast
Class does not have a destructor which is recommended since it has dynamic memory/resource allocation(s).
Undefined behaviour
Shifting a negative value is technically undefined behaviour
Passing NULL after the last typed argument to a variadic function leads to undefined behaviour.