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 047583858D1E for ; Fri, 8 Sep 2023 13:09:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 047583858D1E 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=1694178566; 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:in-reply-to:in-reply-to: references:references; bh=EZ/EvF6E2E0wnt+MjnymMNH3cF1LDn9YEfEqoAuN+r8=; b=Yku/lLWAXxaTl/Ka3Q6CHrzlhqvOSqDnMym/s3mXCh7+kg6JQ29dEu73HBmnkankd/Ik2I O0gd2EsdsGV8hBMufrFe582sjKZVOPKb91/So0VTgw82yNetjT3DH7RiyBj31Q6gpglAcX SOy8RQ+t+su6wyBnHSOd5zkQzqqeKxE= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-650-cYYQ0ROaMGK8ROITyGZe6A-1; Fri, 08 Sep 2023 09:09:25 -0400 X-MC-Unique: cYYQ0ROaMGK8ROITyGZe6A-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 11B5F3C21641; Fri, 8 Sep 2023 13:09:25 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.45.225.172]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9CE2D2026D33; Fri, 8 Sep 2023 13:09:24 +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 388D9N911035592 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 8 Sep 2023 15:09:23 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 388D9Mr31035591; Fri, 8 Sep 2023 15:09:22 +0200 Date: Fri, 8 Sep 2023 15:09:22 +0200 From: Jakub Jelinek To: Arthur Cohen Cc: gcc-patches@gcc.gnu.org, tromey@redhat.com, gcc-rust@gcc.gnu.org, Raiki Tamura Subject: Re: [PATCH] libcpp: add function to check XID properties Message-ID: Reply-To: Jakub Jelinek References: <20230908125840.789518-1-arthur.cohen@embecosm.com> MIME-Version: 1.0 In-Reply-To: <20230908125840.789518-1-arthur.cohen@embecosm.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,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 Fri, Sep 08, 2023 at 02:58:40PM +0200, Arthur Cohen wrote: > From: Raiki Tamura > > libcpp/ChangeLog: > > * charset.cc (check_xid_property):new function to check XID_Start and XID_Continue > * include/cpplib.h (check_xid_property):add enum representing XID properties Just random comments, not a proper review. 1) functions exported from libcpp should IMNSHO use the cpp_ prefix 2) similarly the enumerators should be prefixed with CPP_ 3) formatting of the ChangeLog entry is incorrect. There should be a space after ): followed by uppercase rather than lowercase letter, descriptions should end with . and there should be line wrapping so that it fits into 80 columns. For a new function, one can just say New. or New function., doesn't need to describe what it is good for. And the include/cpplib.h changes don't describe what actually changed. A new anonymous enum (why not a named one?) was added, and check_xid_property declared. > --- a/libcpp/include/cpplib.h > +++ b/libcpp/include/cpplib.h > @@ -1606,4 +1606,11 @@ bool cpp_valid_utf8_p (const char *data, size_t num_bytes); > bool cpp_is_combining_char (cppchar_t c); > bool cpp_is_printable_char (cppchar_t c); > > +enum { > + XID_START = 1, > + XID_CONTINUE = 2 Formatting. There should be indentation just by 2 columns rather than 3. Jakub