Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp448237pxb; Sat, 6 Mar 2021 05:11:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJz+CI+iM/X2SWLKdw7Xx/w+LjSHB09dqOgPaRnNpY9RgfKGfMqIwIXaLLmsDyFEwzn9niDO X-Received: by 2002:a50:9dcd:: with SMTP id l13mr13850396edk.220.1615036272732; Sat, 06 Mar 2021 05:11:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615036272; cv=none; d=google.com; s=arc-20160816; b=eYhUwAIgPojJuAe4OVajQ7jEBYPIk5G3U0g7frCloAJND1jdOQRvVgzDjqtrFsbRtJ WZ5ShvVkRdhMA69Elxsj8Ll1KISoJ6HF99vp/nABGCWCsdJO/1d0YdUTpMz2azhaWj0s eW8tlNm1UVTDdghZKEwba5s456Wkkw6SO0lfPoBoukZnjefc90U8A65id5MNBrdOs49o lO8u9q2vO35K9rvDLCh7i2OrtVgNvqR21QVgdGGVpw7Hubdah0uO01nwDBQq+rye9Wkd kE1HE3Bz0gX29oMb777NzTN2i++oml8WHu19PHfqHfhM4l0hLG5hx/5d0vpYpnxnQ0qp yFpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=ATpFGSJY46yedmzJDru9SiqB2GPuBTTkX5e7hHNDmgQ=; b=sJrQCXraa4Xm+WNypUpfgre427j0WVeQjk7DXCVDPNx+ZLseD3cayT0bqva09yywDw 3RkRjyUll50UaHkrA9En8y2yqnyGwuySn07MMON3ixErlBPqHZUQkMKHiFIJJ/sq9yFj mDE9xpqYQSEe25/t990qQVwgMgYxDri32fs6+97j/99PfsW5eRWjfKKVcZuDSbq2qdqD 2fHBkMHtkwDjoPbRWVsaBc7BYf7fNq3jSd8OdXL7wdqBj13fT8F6azLSzU5Tz5etDjqQ RlKIBPVq75R6shtm5fTyjOBGrL0/x9HU9IZJZ7rT1B/3BNCa/lGuS78YI+Bf++G8jYVb loOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OewBR4mF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l4si3090390eje.225.2021.03.06.05.10.49; Sat, 06 Mar 2021 05:11:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OewBR4mF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230242AbhCFNHn (ORCPT + 99 others); Sat, 6 Mar 2021 08:07:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42700 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229888AbhCFNHj (ORCPT ); Sat, 6 Mar 2021 08:07:39 -0500 Received: from mail-yb1-xb2b.google.com (mail-yb1-xb2b.google.com [IPv6:2607:f8b0:4864:20::b2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1813C06174A; Sat, 6 Mar 2021 05:07:38 -0800 (PST) Received: by mail-yb1-xb2b.google.com with SMTP id u75so4981545ybi.10; Sat, 06 Mar 2021 05:07:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=ATpFGSJY46yedmzJDru9SiqB2GPuBTTkX5e7hHNDmgQ=; b=OewBR4mFIG8qQm3SnYpRZvdV1lvJMb9wI45+5gWV4CaJ8QC+pQm3YBPnuimVmsWq61 JU9LoZBvZSijQn/fb5FrWhmX3mcVAl+G8vB6LkgzQprzcO3kMxbhlEepzYr9Hxpnp2R+ 0ody94zv8NgPQyW5hYB9rjRkvyHHCkyOTxE5S0CUTf7xrIBtvWvlqeoIJqe6JqstYA1w 6zvA43o+5OML4aoRcvcpPFAqiqrWRs+unbojR18EV/Ysg8+UkUc/AXDjbSVNn5eFxVx3 +p0ArbvnOz7LO/rGTVoew8+k+t4LCFLlVEHAucohQPtQqNSXTLtehP//H/5GW46ZXbS2 Jh7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=ATpFGSJY46yedmzJDru9SiqB2GPuBTTkX5e7hHNDmgQ=; b=irD1zS8dLpWfcaIVAdqXG3uN5CpqsYWhNgnhWtF5ARd9c4yJUhRNYenkqtZ7JfHcOO FKKUtxgCFrmDhkqp8gGY6CYFh3G/AmKIIqa7zUv2hb+VIGHh4dHe1YeSzUiA+X8Jofpq 8yPzdPs6ybSnDKi1HOWr4LOvvCEivHZjLFSPjup6wpsR2INIrULHXVOyn4IO2R8LSToG P1jAn2oqMU3EO9tSc9HJyazaGFttWvffm1qjOxtmqI2M3OtoziE/EHTsHD3YXirIikDh szN18NStXM9xA5lRBf42Ku92/DY2NPwUzUGgbXP2XIvFa26lTNMQgLNY4wUo1+1pCiGW rkIg== X-Gm-Message-State: AOAM533HqEMlqOYKWuWopFIlzA4nUbVgOAAc1g4jGMCXiLUGpfTedLko LfCtWcJQFATKWUN5ZKdT08v+ZsxDdO4iuLAPr8M= X-Received: by 2002:a25:d296:: with SMTP id j144mr21120022ybg.33.1615036058165; Sat, 06 Mar 2021 05:07:38 -0800 (PST) MIME-Version: 1.0 References: <877dmo10m3.fsf@tromey.com> <4835ec1d2ecc40b285596288a0df4f47@AcuMS.aculab.com> <44a0cc9cb5344add8ee4d91bffbf958f@AcuMS.aculab.com> In-Reply-To: From: Miguel Ojeda Date: Sat, 6 Mar 2021 14:07:27 +0100 Message-ID: Subject: Re: [PATCH 00/11] pragma once: treewide conversion To: Linus Torvalds Cc: David Laight , Tom Tromey , Alexey Dobriyan , Luc Van Oostenryck , Linux Kernel Mailing List , Andrew Morton , Sparse Mailing-list Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 5, 2021 at 10:25 PM Linus Torvalds wrote: > > And regardless of even _those_ issues, you still should do all the > other syntactic tokenization stuff (ie all the quoting, the the > character handling: 'a' is a valid C token, but if you see the string > "it's" outside of a comment, that's a syntax error even if it's inside > a disabled region. IOW, this is an incorrect file: > > #if 0 > it's a bug to do this, and the compiler should scream > #endif > > because it's simply not a valid token sequence. The fact that it's > inside a "#if 0" region doesn't change that fact at all. So you did > need to do all the tokenization logic. Compilers don't scream that much, only GCC seems to give a warning. I assume it is because it is just undefined rather than a required error/diagnostic, i.e. the "If a =E2=80=99 or a " character matches the las= t category, the behavior is undefined." in 6.4. Concerning #pragma once: I actually would like to have a standard #once directive if what is a "seen file" could be defined a bit more precisely. Even if just says it creates a guard with something similar to the result of `__FILE__` would be good enough for many projects out there, and one can still use guards when flexibility is needed and/or corner cases are expected (which, if detected, the compiler could also warn about). Cheers, Miguel