public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: "Φώτης Βαλασιάδης" <barryvalasiadis@gmail.com>
To: gcc@gcc.gnu.org
Subject: GSoC thoughts on C++ static analyzer support
Date: Fri, 15 Apr 2022 22:27:27 +0300	[thread overview]
Message-ID: <CA+NJ8V+B3q3gOM81Wg0GFLVGP3jRuSopoto_71DuO0Ea1Qzbyw@mail.gmail.com> (raw)

Hello all,

I am interested in said project, and I'd like to ask.

Is said project limited to providing static analysis for heap allocations
and file handles?  To be clear I am asking whether or not there are goals
beyond these two.

This pattern could pretty much be used for all resource-like objects such
as sockets, mutexes et cetera and point is that said problems in C++ are
already tackled by using RAII
<https://en.cppreference.com/w/cpp/language/raii>. Now I understand that
RAII isn't always an option nor does it solve all problems (for example,
dangling references) so I am still fascinated by all of it and would like
to share my thoughts.

C++11 mutexes(locks, and generally speaking all thread header facilities)
could really use a static analyzer. Not only for the standard lock(),
unlock() checks but also for "enforcing" lock ordering and other important
guidelines. Read Anthony William's "Concurrency in Action" a while ago and
honestly if I had a compiler that performed all those checks he describes
in the book for me, which half of them I don't even remember anymore, THAT
would be something else.

Now I understand that this might be really complicated for a GSoC project,
but food for thought. Looking forward to hearing your thoughts on this.

Thanks for your time!

             reply	other threads:[~2022-04-15 19:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-15 19:27 Φώτης Βαλασιάδης [this message]
2022-04-16 12:05 ` David Malcolm

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=CA+NJ8V+B3q3gOM81Wg0GFLVGP3jRuSopoto_71DuO0Ea1Qzbyw@mail.gmail.com \
    --to=barryvalasiadis@gmail.com \
    --cc=gcc@gcc.gnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).