File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
cpp/misra/src/rules/RULE-8-2-8 Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change 1515
1616import cpp
1717import codingstandards.cpp.misra
18+ import codingstandards.cpp.types.Type
1819
19- from ReinterpretCast cast , Type targetType , Type sourceType
20+ from ReinterpretCast cast , PointerType sourceType , Type targetType
2021where
2122 not isExcluded ( cast , Conversions2Package:: pointerToIntegralCastQuery ( ) ) and
2223 sourceType = cast .getExpr ( ) .getType ( ) .getUnspecifiedType ( ) and
23- sourceType instanceof PointerType and
2424 targetType = cast .getType ( ) and
2525 targetType .getUnspecifiedType ( ) instanceof IntegralType and
26- not (
27- targetType .( UserType ) .hasGlobalOrStdName ( "uintptr_t" ) or
28- targetType .( UserType ) .hasGlobalOrStdName ( "intptr_t" )
29- )
26+ not stripSpecifiers ( targetType ) .( UserType ) .hasGlobalOrStdName ( [ "uintptr_t" , "intptr_t" ] )
3027select cast ,
31- "Cast of object pointer type to integral type '" + targetType . toString ( ) +
28+ "Cast of object pointer type to integral type '" + targetType +
3229 "' instead of 'std::uintptr_t' or 'std::intptr_t'."
You can’t perform that action at this time.
0 commit comments