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.129.124]) by sourceware.org (Postfix) with ESMTPS id 40C843858D1E for ; Tue, 19 Jul 2022 20:08:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 40C843858D1E Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-487-1egYfszVNC21N53npAbatQ-1; Tue, 19 Jul 2022 16:08:43 -0400 X-MC-Unique: 1egYfszVNC21N53npAbatQ-1 Received: by mail-qk1-f198.google.com with SMTP id o13-20020a05620a2a0d00b006b46c5414b0so12760687qkp.23 for ; Tue, 19 Jul 2022 13:08:43 -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:cc:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=DStTmClQscvWLNMUnUjupa9RDiBTFFJt0ib9okQ0kJg=; b=wnqrdbpiTkDnyDrbpV5urlwPC7KRC27xLUVoxATWp0eh2/eAzaqputUwH7nsbJBIi2 Mx14IrFPkykmQZzX1cNf3J/xyF0lBMTK+F+kH88DT+JM3VHpSFap83kGFxyvz85dwNq/ 8oN6gbFEdnL8NPft1Vt+BmqiWmJBlqHSxlRyuEOTTF1+eGmqnyH8uo0axQRf5cVYQGNG QaX7M0HO+3N6woIbWr5YqGrL7N4xIoyFB7HeNSPeEkPWKNqn2v8yTC/W7L9qG0tbqMDO 1WfjOcMONeP7KNeIFmVI5X9Yi3Z0sblqOup+d+KhApHDdCnNT38Ljclai3G1uc344vBY R0UQ== X-Gm-Message-State: AJIora+R9hNDQmXgrhqcb5anUiUAkwnMXfy3cpYOYlxxLE0Q1E6svaFN sjiDwZ310E2or+cBS+vhyWrs3MhMFVAUCZy+JP2KzQAONZnQMQJvB6XZuwa9fghuqOcbJSDy4v6 RnnZrQnch3O7HWAr/4A== X-Received: by 2002:ae9:e502:0:b0:6b5:527f:f1b5 with SMTP id w2-20020ae9e502000000b006b5527ff1b5mr22051623qkf.566.1658261323408; Tue, 19 Jul 2022 13:08:43 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tMDEylkG5dwmGDpyZKDohp63Hn+jdkzAVM0l5PJcJ5YEworLBikWVUc3X4uu5MLo/e1/QzBQ== X-Received: by 2002:ae9:e502:0:b0:6b5:527f:f1b5 with SMTP id w2-20020ae9e502000000b006b5527ff1b5mr22051612qkf.566.1658261323211; Tue, 19 Jul 2022 13:08:43 -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 fp33-20020a05622a50a100b0031eaea83fc1sm10968504qtb.47.2022.07.19.13.08.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Jul 2022 13:08:42 -0700 (PDT) Message-ID: <0f9319d622d9fe195d994e847c7d87a54f416e07.camel@redhat.com> Subject: Re: [PATCH] Adding three new function attributes for static analysis of file descriptors From: David Malcolm To: mirimnan017@gmail.com, gcc-patches@gcc.gnu.org Cc: Immad Mir Date: Tue, 19 Jul 2022 16:08:41 -0400 In-Reply-To: <1e44d1ae1933ed588ee91fbc296683a7428f18e6.camel@redhat.com> References: <1e44d1ae1933ed588ee91fbc296683a7428f18e6.camel@redhat.com> 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=-6.6 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 Jul 2022 20:08:46 -0000 On Tue, 2022-07-19 at 14:18 -0400, David Malcolm wrote: > On Tue, 2022-07-19 at 21:36 +0530, Immad Mir wrote: > [...snip...] > > > > +void > > +fd_state_machine::check_for_fd_attrs ( > > +    sm_context *sm_ctxt, const supernode *node, const gimple > > *stmt, > > +    const tree callee_fndecl, const char *attr_name, > > +    access_directions fd_attr_access_dir) const > > +{ I had another idea about the patch: we have attr_name here, and thus I think it's available when creating the various fd_param_diagnostic instances, so why not convert the: bool m_attr; in fd_param_diagnostic to: const char *m_attr_name; // can be NULL if no attribute involved and then, when it's non-NULL we can use it directly in the inform message, so that the attribute name we report is the one that the user used. I think that's clearer, both for us and for the end-user. Dave