From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by sourceware.org (Postfix) with ESMTPS id 631013858D28 for ; Wed, 21 Jun 2023 07:36:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 631013858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-ej1-x630.google.com with SMTP id a640c23a62f3a-98862e7e3e6so503536666b.0 for ; Wed, 21 Jun 2023 00:36:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687333008; x=1689925008; h=cc:to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=C+Hup6M5vH2z8LjBuXxwt4tm4c3peElCHMr6YAZqi7s=; b=F2BPYgSO/RHI9n6vjFdzCGmGd3ZzphX3co77ji3FXLdc8cRi39niG0YJKsZeRrGD9i 32bEOSPIZtPChs4D4gJWEIGHXW8/d6Ga0NPsuVhgG+sXF+9TUYZlKRJg5nLVHTtp4w3i nZ8JYyir6AZM66Xdu+HkIV6wBS8nkcP3u3HXrOxkCv1RcbCXKI6DiKFyK9zifyFhkVnu vhSUl/Rlt3q36HvYeQaT0Gb2BoUYRvt6H4asBfAWkeqypCm7gcGZt+3VK5/Ulji4tSp8 j1qXg8jM7evRGCRDN0axdZMFR+o+jNiSoZy8hVSEd89j8wrWhvqo9DdFga/CcmNU9eeq IElw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687333008; x=1689925008; h=cc:to:subject:message-id:date:from:reply-to:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=C+Hup6M5vH2z8LjBuXxwt4tm4c3peElCHMr6YAZqi7s=; b=jqlBcbIMZ4she9PcEClTqE+IeDVs5DyY0+GADRvYC/0f0iliiafrzDkBuXM9dqRqtq L0pnedA2b1IUser0rk0t1m81NymxB89+eAPlxyZp+37BfwoMN9VTOWGOtvS6Z+Nq3L+c NZ2izGJrOj4MQbjCzSWUVy3NmMvoMr/Pt06H25cYZtiFs1Jc54fLZDf1SWQkKa9ONcXW +KhNFTi5HtUPRHTtSn1MVBDamS5N73KSWsCwBKT+rsh9OX60IosTAkoB9KDmYXiKMaD/ ReCldxkVU6iy8PCMb3FgKmHxxxoObHbBbpI0m6cOA/bo+I5NrT/2g1cOV0kCzd9CtwXG eJcg== X-Gm-Message-State: AC+VfDzZgnqyDcWB3yo+NX2jHW0ygwUjnsFWmkYXJMMNYZA1bcCjqd+7 0kIPOcALKx1B0FBrYlGYr5KRERXkWMmySL1uXOs= X-Google-Smtp-Source: ACHHUZ6kvofPDF4RQV5ns4NV7kXXRcfiHVJOZyNwbjzJSWdn5VjyeOH28l/gDQaEdYoBBy7vPVJ9TLV6ze0y2MfjKnQ= X-Received: by 2002:a17:907:16a1:b0:988:d1d5:cd5b with SMTP id hc33-20020a17090716a100b00988d1d5cd5bmr6502971ejc.75.1687333007918; Wed, 21 Jun 2023 00:36:47 -0700 (PDT) MIME-Version: 1.0 References: <20230620171731.230-1-luoyonggang@gmail.com> <20230620171731.230-2-luoyonggang@gmail.com> <2c0b7268-4efd-4ace-beef-9155501ed700@app.fastmail.com> In-Reply-To: Reply-To: luoyonggang@gmail.com From: =?UTF-8?B?572X5YuH5YiaKFlvbmdnYW5nIEx1byk=?= Date: Wed, 21 Jun 2023 15:36:37 +0800 Message-ID: Subject: Re: [PATCH v2 1/4] clang-format: should format with 2 space and do not usage tab To: Xi Ruoyao Cc: Zack Weinberg , Jens Gustedt , GNU libc development , Florian Weimer Content-Type: multipart/alternative; boundary="0000000000008e0ad805fe9ed4c0" X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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: --0000000000008e0ad805fe9ed4c0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Jun 21, 2023 at 3:13=E2=80=AFPM Xi Ruoyao wrot= e: > > On Wed, 2023-06-21 at 14:55 +0800, =E7=BD=97=E5=8B=87=E5=88=9A(Yonggang L= uo) wrote: > > > Because the existing code uses one tab for 8 spaces. Glibc has its own > > > coding standard, not "what you prefer". > > > > I am also talking about the existing code, so the conclusion is the existing code > > is not consistent, some use one tab for 8 spaces, some use spaces directly > > Anyway "TabWidth: 2" is wrong. If you want to avoid tab at all, the > TabWidth setting is irrelevant and should be removed. > > We already have "UseTab: Always" and "IndentWidth: 2", these matches the > description of Zack. As the patch adding .clang-format had been > reviewed (the commit adding it even contains an R-b tag from Carlos), it > implies the current consensus for new code is to *always* tabs for 8 > spaces. > > -- > Xi Ruoyao > School of Aerospace Science and Technology, Xidian University The output of clang-format --style=3DGNU -dump-config is: ``` StatementMacros: - Q_UNUSED - QT_REQUIRE_VERSION TabWidth: 8 UseCRLF: false UseTab: Never WhitespaceSensitiveMacros: - STRINGIZE - PP_STRINGIZE - BOOST_PP_STRINGIZE - NS_SWIFT_NAME - CF_SWIFT_NAME ``` So yeah, UseTab: Never is enough. -- =E6=AD=A4=E8=87=B4 =E7=A4=BC =E7=BD=97=E5=8B=87=E5=88=9A Yours sincerely, Yonggang Luo --0000000000008e0ad805fe9ed4c0--