From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 97B41385803E for ; Sat, 16 Apr 2022 12:06:02 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 97B41385803E Received: from mail-qk1-f197.google.com (mail-qk1-f197.google.com [209.85.222.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-474-Uz6zOGpWMBqonKPkHYQvCA-1; Sat, 16 Apr 2022 08:06:01 -0400 X-MC-Unique: Uz6zOGpWMBqonKPkHYQvCA-1 Received: by mail-qk1-f197.google.com with SMTP id br18-20020a05620a461200b0069bfc9fdb0dso7138847qkb.21 for ; Sat, 16 Apr 2022 05:06:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=DvCeK9+TQiqDQrZ3wyZmSOE+/U8fpKRKK7itvfTLYYI=; b=c8XalXvFnWx0KSr4+Y0s5j/D7f9gPPHzy5J01nCua/CPS+MVrg2L+/VYgNcVygCiwF 4mFaMaGut3guNOa+CCgbRh49BnOc589Jr2eIRNa0/dlfZMXympC6mV3JUUGUO12egh6G NQwXId2Nb19BwpCkwILge0GOGbszMqdKxVa4/XC50XkEno3lyplgrEb3gPx67J620mgf DIhQwwkwt//H89irxNjQnf+XZbHdbCZNDcIsKGXt3nM5+zxFVF1ZJNa7hXDSJKP65DC6 BZy/+U/79eW7GTvnMh5UC5zmnr1qtaldAAvW3gevKTlu4hyDkzwNibXRV6xRh7eJk/kb nseA== X-Gm-Message-State: AOAM531y0TiAnCOodrq1fm1+bS1qRGLIQ8u3J3lo8cVeWO2jWVJMAyNw SFOxZzEIP3542qim0aIM/bZqPZh6IuH5kkZLpSviL6gDLxlTyy+ujNsW6FBV9A6fuPDLQAKdNgN pKHXYBO8= X-Received: by 2002:a05:622a:16:b0:2eb:86e1:3dfd with SMTP id x22-20020a05622a001600b002eb86e13dfdmr2026307qtw.659.1650110760048; Sat, 16 Apr 2022 05:06:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJynf5jcZh3uShtsU11r9q93Yb8M6CN6gkGSQQuh9ABrM3oc7GlZhZDJbW/UYdwOUW0n/6wkpw== X-Received: by 2002:a05:622a:16:b0:2eb:86e1:3dfd with SMTP id x22-20020a05622a001600b002eb86e13dfdmr2026288qtw.659.1650110759736; Sat, 16 Apr 2022 05:05:59 -0700 (PDT) Received: from t14s.localdomain (c-73-69-212-193.hsd1.nh.comcast.net. [73.69.212.193]) by smtp.gmail.com with ESMTPSA id b13-20020ac85bcd000000b002e06856b04fsm4586998qtb.51.2022.04.16.05.05.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Apr 2022 05:05:59 -0700 (PDT) Message-ID: <06beb91012365d233e51c3b0354eed44a871d86f.camel@redhat.com> Subject: Re: GSoC thoughts on C++ static analyzer support From: David Malcolm To: =?UTF-8?Q?=CE=A6=CF=8E=CF=84=CE=B7=CF=82_?= =?UTF-8?Q?=CE=92=CE=B1=CE=BB=CE=B1=CF=83=CE=B9=CE=AC=CE=B4=CE=B7=CF=82?= , gcc@gcc.gnu.org Date: Sat, 16 Apr 2022 08:05:57 -0400 In-Reply-To: References: User-Agent: Evolution 3.38.4 (3.38.4-1.fc33) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, BODY_8BITS, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, KAM_SHORT, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gcc@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Apr 2022 12:06:03 -0000 On Fri, 2022-04-15 at 22:27 +0300, Φώτης Βαλασιάδης via Gcc wrote: > Hello all, Hi! > > 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 > . 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. This sounds fascinating, but unfortunately, the analyzer doesn't fully support all of C++ yet, and so there's a lot of work to be done before such a project could be attempted; some of that could make for a GSoC project. FWIW, there's a tracker bug for C++ support in the analyzer here: https://gcc.gnu.org/bugzilla/showdependencytree.cgi?id=97110 and some of those things (e.g. exception-handling) are challenging. In addition to those specific things, before we can really say that we "support C++" I think there would also need to be a lot of simply using the analyzer on C++ codebases to see what happens (including using it on GCC's code itself) - the "unknown unknowns", as it were. BTW, I'm about to go on a week-long trip, and will be away from my computer during that time, so I probably won't be able to send further emails before the application deadline. Hope this is helpful Dave