Mitesh Shah wrote: > Has any one have any idea about how to sparse C++ code? Is there any > wrapper or converter to convert it to C before passing it to sparse? Sparse doesn't support C++ natively. In theory, someone could write a C++ frontend that provides similar output to the C frontend (same data structures and linearized bytecode format), but barring someone providing the *huge* pile of code this would require *and* committing to support it, I don't see this happening anytime soon. (That said, if someone genuinely has an interest in doing so, feel free to contact linux-sparse@xxxxxxxxxxxxxxx to coordinate.) Some tools exist to translate C++ to C, most of them proprietary and most of them quite old. Some of them come from the days when everyone used such tools to compile C++ in the first place. To the best of my knowledge, all of these tools primarily target the ability to compile with a C compiler; they don't target easily readable C code. If you could manage to get the Sparse keywords to pass through them into the C code, you *might* manage to get some useful semantic warnings out of one of them, such as locking validation or user/kernel pointer checking, though you'd have to wade through a lot of noise to find them. - Josh Triplett
Attachment:
signature.asc
Description: OpenPGP digital signature