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 ECB21385AC2C for ; Wed, 5 Oct 2022 12:01:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org ECB21385AC2C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664971292; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zN59na6ou+5vt+BYkRSoaGRcIO9aBDOAWkLvnc5qtGg=; b=X/kjReX54qeOnJhYxnW7fjUHVioJ6mOljcPxUCe72YC0vWSlVIdgHEARen8UIamW7TSNmj obTG63Ok+1Jv1NP1Cd4OjfEt1kgvN6Cxp5hNFUDWstlKT17r1j2YQY5Hz50XCWGzIRy7Xd Y6kIxCYmSxtDzBJdbc9+8ByNMYYmlTo= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-304-P9AP9U8AP4CjjOLkDM_RxA-1; Wed, 05 Oct 2022 08:01:31 -0400 X-MC-Unique: P9AP9U8AP4CjjOLkDM_RxA-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B3119800B30; Wed, 5 Oct 2022 12:01:25 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.194]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 30222468A41; Wed, 5 Oct 2022 12:01:13 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 295C1And4087909 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Wed, 5 Oct 2022 14:01:11 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 295C19Im4087908; Wed, 5 Oct 2022 14:01:09 +0200 Date: Wed, 5 Oct 2022 14:01:08 +0200 From: Jakub Jelinek To: Martin =?utf-8?B?TGnFoWth?= Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH] c: support attribs starting with '_' Message-ID: Reply-To: Jakub Jelinek References: MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,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 List-Id: On Wed, Oct 05, 2022 at 01:49:40PM +0200, Martin Liška wrote: > PR c/107156 > > gcc/ChangeLog: > > * attribs.h (lookup_attribute_by_prefix): Support attributes > starting with underscore (like _noreturn, or __Noreturn). There are no _noreturn or __Noreturn attributes, there is just _Noreturn. And, the assert is useful to catch that non-canonicalized attributes don't make it into the attribute lists. Now that we have the first attribute that starts with an underscore in canonicalized form (do we accept ___Noreturn__ attribute too, perhaps we shouldn't?), I'd say instead of removing the assert it should verify gcc_checking_assert (attr_len == 0 || p[0] != '_' || (ident_len > 1 && p[1] != '_')); ? > --- > gcc/attribs.h | 2 -- > 1 file changed, 2 deletions(-) > > diff --git a/gcc/attribs.h b/gcc/attribs.h > index b2836560fc2..706d35e63d8 100644 > --- a/gcc/attribs.h > +++ b/gcc/attribs.h > @@ -274,8 +274,6 @@ lookup_attribute_by_prefix (const char *attr_name, tree list) > } > > const char *p = IDENTIFIER_POINTER (name); > - gcc_checking_assert (attr_len == 0 || p[0] != '_'); > - > if (strncmp (attr_name, p, attr_len) == 0) > break; > > -- > 2.37.3 Jakub