All of lore.kernel.org
 help / color / mirror / Atom feed
From: Josh Triplett <josh@freedesktop.org>
To: Mitesh Shah <Mitesh.Shah@arc.com>
Cc: "Linux-Sparse (E-mail)" <linux-sparse@vger.kernel.org>
Subject: Re: C++ support
Date: Tue, 01 May 2007 10:50:37 -0700	[thread overview]
Message-ID: <46377DED.5070608@freedesktop.org> (raw)
In-Reply-To: <DAE2DE304D25FE4FA8D2B55FBB0842DA010B73@sjvm-exch01.arc.com>

[-- Attachment #1: Type: text/plain, Size: 1291 bytes --]

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@vger.kernel.org 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 #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]

      reply	other threads:[~2007-05-01 17:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-30 18:36 C++ support Mitesh Shah
2007-05-01 17:50 ` Josh Triplett [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46377DED.5070608@freedesktop.org \
    --to=josh@freedesktop.org \
    --cc=Mitesh.Shah@arc.com \
    --cc=linux-sparse@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.