Details
-
Bug
-
Resolution: Done
-
P4: Low
-
5.1.0 , 5.1.1
-
None
-
409655f3451815930b70a71baa175ab9f34467ed
Description
Hello!
We want to compile our code with the gcc compiler flag "-Wold-style-cast".
Trying that we found a usage of an old style cast:
--- a/src/xmlpatterns/api/qabstractxmlnodemodel.h +++ b/src/xmlpatterns/api/qabstractxmlnodemodel.h @@ -95,7 +95,7 @@ namespace QPatternist /* Constructing to qptrdiff means we avoid the warning "cast to pointer * from integer of different size." */ - return (void *)qptrdiff(data); + return reinterpret_cast<void *>(qptrdiff(data)); } Data additionalData;
Please fix this one and all other C style casts in Qt5.
C style casts are not necessary in C++ code and can cause ugly bugs.
For example this code would compile without an error:
void myFunc(const Type1 &var) const { Type2 &my_var = (Type2 &)var; }
BR Gerhard