3 ms·
Now find casts that are known to be as unsafe as reinterpret cast for the whole set of types your codebase deals with to audit a violation of the type system. W
by germandiago 4y ago
Now find casts that are known to be as unsafe as reinterpret cast for the whole set of types your codebase deals with to audit a violation of the type system. What would you grep?
I would grep 'reinterpret_cast' and I would set warning as error for the c-style casts. So you can assume my codebase does not have any.
I will find any cast to reference, pointer, etc. for any type. How would you do tjat if you do:
(int)a
((int)(MyType*))
and many, many more...
- robotresearcher 4y agoThat makes sense, thanks. Grepping for C syntax casts with arbitrary stuff between the parens is clearly not going to work.