From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by sourceware.org (Postfix) with ESMTPS id 2706C3858421 for ; Sat, 6 Nov 2021 01:32:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 2706C3858421 Received: by mail-wr1-x42a.google.com with SMTP id c4so16372696wrd.9 for ; Fri, 05 Nov 2021 18:32:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:references :message-id:mime-version:content-transfer-encoding; bh=++LyzsLksfuDvUVhVxGFfIMMzMu6s3zNMaapbIQ+9IA=; b=w3vE0V99tQdLC1pVUQrTvAO3zjuyOCQRHOu1QZnVUcBxf+JaJnRMblvt1pAiROkN1P sCpRloLdnJpcvdlejeYXrPIOBctwEZfqvs1Vh7gOCFwP1vGKERnWdlRIkrGz15QU6lvg qnqI/zcXr0RdNV3NRSn8c/1LwMxokY2hzuU3CVxIrtgOX4LajtRD8RPjCnwuIaRQ7a5i ThN+2iIF5Xp65Q3wjUcVQgbd8Bvjx4005BuY3inODEu31dMz3eX1oeY8wIhUKlaKNDWC A7okdL8id8286MUB6qcb6A8uFXQXw+rr3qlSuW4+G9lnf0nKlosfJiIT8Dd8lFlMvv34 FDDg== X-Gm-Message-State: AOAM5310UUyenV4H5PJ7TPTaOuTxC2W7kCGYZtvvWf1GZixNKJxmPtTT N1w8utL/Dq3aRclI2MGP+SI= X-Google-Smtp-Source: ABdhPJzXeUn/GpNl0LYd759Gbbc80VR6GZZTTI+LNkLCrVlFYnkSXGTDlwRNL9n13u9cWGJOoYSi3g== X-Received: by 2002:a5d:4b8a:: with SMTP id b10mr51043603wrt.413.1636162351081; Fri, 05 Nov 2021 18:32:31 -0700 (PDT) Received: from ?IPv6:::1? (dynamic-2bq7derzm6dmrakhl0-pd01.res.v6.highway.a1.net. [2001:871:227:33a8:19e6:7641:3ea0:cc04]) by smtp.gmail.com with ESMTPSA id d8sm9286024wrm.76.2021.11.05.18.32.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 05 Nov 2021 18:32:30 -0700 (PDT) Date: Sat, 06 Nov 2021 02:32:26 +0100 From: Bernhard Reutner-Fischer To: Marek Polacek , Marek Polacek via Gcc-patches , Jason Merrill CC: Jakub Jelinek , GCC Patches Subject: =?US-ASCII?Q?Re=3A_=5BPATCH_v5=5D_attribs=3A_Implement_-W?= =?US-ASCII?Q?no-attributes=3Dvendor=3A=3Aattr_=5BPR101940=5D?= In-Reply-To: References: <20210920170658.28014-1-polacek@redhat.com> <20210920173859.GK304296@tucnak> <20210920190809.GM304296@tucnak> <8636350f-e588-12d1-b687-89245de0b62d@redhat.com> <89690210-3ac3-9486-1fa0-742fc67d3748@redhat.com> Message-ID: <84D9B2CE-EA9B-46FB-9BF5-809D29B7018E@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-10.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP 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-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: Sat, 06 Nov 2021 01:32:33 -0000 On 6 November 2021 01:21:43 CET, Marek Polacek via Gcc-patches wrote: > >Thanks, so like this? I'm including an incremental diff so that it's >clear what changed: > >diff --git a/gcc/attribs=2Ec b/gcc/attribs=2Ec >index d5fba7f4bbb=2E=2Eaddfe6f6c80 100644 >--- a/gcc/attribs=2Ec >+++ b/gcc/attribs=2Ec >@@ -237,7 +237,7 @@ check_attribute_tables (void) > the end of parsing of all TUs=2E */ > static vec ignored_attributes_table; >=20 >-/* Parse arguments ARGS of -Wno-attributes=3D=2E >+/* Parse arguments V of -Wno-attributes=3D=2E > Currently we accept: > vendor::attr > vendor:: >@@ -252,12 +252,15 @@ handle_ignored_attributes_option (vec *v) >=20 > for (auto opt : v) > { >+ /* We're going to be modifying the string=2E */ >+ opt =3D xstrdup (opt); > char *q =3D strstr (opt, "::"); > /* We don't accept '::attr'=2E */ > if (q =3D=3D nullptr || q =3D=3D opt) > { > error ("wrong argument to ignored attributes"); > inform (input_location, "valid format is % or %"); >+ free (opt); > continue; > } Only xstrdup here, after the strstr check? Should maybe strdup the rest here, not full opt=2E=2E thanks, > /* Cut off the vendor part=2E */ >@@ -274,6 +277,7 @@ handle_ignored_attributes_option (vec *v) > if (!valid_p (vendor) || !valid_p (attr)) > { > error ("wrong argument to ignored attributes"); >+ free (opt); > continue; > } > /* Turn "__attr__" into "attr" so that we have a canonical form of